Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Physics
Old
XMan771
Junior Member
 
Status: Offline
Posts: 2
Join Date: Mar 2011
Default Physics - 04-12-2011, 04:17 PM

Is there a way to add physics in alice e.x lets say theres a ball on the floor and when you run in to it it Rolls across the floor. Thanks
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-12-2011, 06:00 PM

Yes there is a way. It's called dropping blocks of code in a logical way into the methods to make it do the things you want for you. There is no easy way or prewritten code for the physics, you have to create them yourself. Physics can definitely be done in Alice but you have to write some pretty complex code to make it work well.

One of the hardest things to do in Alice is collision detection because it requires you to think of how the physics of collision detection work and then apply it to your program, I have done it in my Maze program where the walls stop you from going through, but if you wanted you could make a physics method where when you get too close to a ball, it makes it roll away from you, you just have to think about how to make it do that. The truth is, you probably have no idea how to do it. I hope its not one of your top priorities because it would take a lot of critical thinking and time to make something as simple as the physics of a ball rolling work. My advice is either to do it without having to mess with physics, or get someone to do it for you (but good luck finding someone to do it for you for free).


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
XMan771
Junior Member
 
Status: Offline
Posts: 2
Join Date: Mar 2011
Default 04-12-2011, 11:54 PM

Quote:
Originally Posted by Dameria View Post
Yes there is a way. It's called dropping blocks of code in a logical way into the methods to make it do the things you want for you. There is no easy way or prewritten code for the physics, you have to create them yourself. Physics can definitely be done in Alice but you have to write some pretty complex code to make it work well.

One of the hardest things to do in Alice is collision detection because it requires you to think of how the physics of collision detection work and then apply it to your program, I have done it in my Maze program where the walls stop you from going through, but if you wanted you could make a physics method where when you get too close to a ball, it makes it roll away from you, you just have to think about how to make it do that. The truth is, you probably have no idea how to do it. I hope its not one of your top priorities because it would take a lot of critical thinking and time to make something as simple as the physics of a ball rolling work. My advice is either to do it without having to mess with physics, or get someone to do it for you (but good luck finding someone to do it for you for free).
Well i can use blender3D wich has a Physics engine to see how the ball would move then replicate it in alice thanks anyway.
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 04-13-2011, 06:07 AM

You can also use things called functions, like if you want the ball to roll across the floor, you can make a function involving pi and the width of the ball to make sure that it rolls at the same speed it moves.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-13-2011, 06:01 PM

Quote:
Originally Posted by TauTrumpsPi View Post
You can also use things called functions, like if you want the ball to roll across the floor, you can make a function involving pi and the width of the ball to make sure that it rolls at the same speed it moves.
Functions basically have an input an output, for something like physics you would use methods. And its harder than just "seeing how it is done in blender3d and replicating it in Alice", I can guarantee that.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 07:03 PM

As far as i know there is not a physics engine for alice(which is what i think you are wanting) you would have to code all the methods for collision detection within alice( ie infinite loop that runs when the world starts then use the if onject is within threshold function) to check for that.
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.