Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 03-07-2011, 11:14 AM

Quote:
Originally Posted by David B View Post
I don't see why collision detection is so exciting. It is very easy to do.
Have you viewed the program? If you look at my code, you will see that this program is more complicated than regular collision detection. I had to use a deviation of both the circle formula ((x-h)^2 + (y-k)^2 = r^2) and the Pythagorean theorem (a^2 + b^2 = c^2) in order to move a object smoothly over a spherically shaped object.


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Question 03-10-2011, 04:03 PM

why couldn't you just use

y = a COS( b x )

where
a is the height (or amplitude) of the hill
b is the width (or period) of the hill
x is the distance to the centre of the base of the hill

and y is the resulting height of the colliding object relative to the hill

EDIT - that would be for the hill object in the object gallery, for a different shape of hill you could calculate it like a basic parabola.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬

Last edited by arty-fishL; 03-10-2011 at 04:07 PM.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 03-10-2011, 10:52 PM

Quote:
Originally Posted by arty-fishL View Post
why couldn't you just use

y = a COS( b x )

where
a is the height (or amplitude) of the hill
b is the width (or period) of the hill
x is the distance to the centre of the base of the hill

and y is the resulting height of the colliding object relative to the hill

EDIT - that would be for the hill object in the object gallery, for a different shape of hill you could calculate it like a basic parabola.
Well, the curvature of the hill doesn't exactly fit a cosine curve I believe. Would you like to edit my example and post your own. Maybe then I can understand. Also, Alice doesn't have an built-in function for calculating the "x" in your equation.


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
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.