Jump to content
  • Advertisement
Sign in to follow this  
rameshSe7en

Skate Math

This topic is 2906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody,

I'm new to this website, so to the game programming. When playing online games, i thought to develop a skate game similar to "Penguin Skate 2". Here is the link for the game www.freegames14.com/Penguin-Skate-2.game2750.html

The problem here is, the movement of character (their it's Penguin) on the curvature. I've studied Foundation Animation in ActionScript 3 & Advanced Animation in ActionScript. But i'm not getting how to move the character in such a way that it seems REAL....

I could store the points on the edges of curve in a static array. But at each frame, i need to rotate the character itself to get aligned to the curved base & then move it.

So if any1 knows the logic behind that, or even if you know any tutorial or reference which would explain that, please let me know.

Thanks in Advance.

Share this post


Link to post
Share on other sites
Advertisement
I think the simplest solution would be to have the character's base defined by a line, rather than a point. So you would determine the height value of the slope at the rear and back of the character, and with that line it would be pretty simple to figure out the rotation.

As for how you are storing the slope data, I think it would be a good idea to have areas defined by a length and a function. For example, a flat downhill section could be defined with the function y = -x, and the length would determine for how long the hill has this slope. That kind of system would make random generation of the hill very simple, and it would make the height calculation for collision/rotation exactly precise. I just came up with that idea now, though, so take it as food for thought, I guess.

Share this post


Link to post
Share on other sites
Thank u very much consequence....

After i posted here, i tried to move the character on the line defined just below the curve rather than the curve itself. Then stored only the end points of lines in a static array. Based on the position of x-value at middle of the character, selected a line whose end points contains the middle x value of character. Then on movement of character on each frame, i checked the collision of character's base with only that line & updated the rotation of character to that line. Then finally checking for the validity of contact line & updating that too.

It's working pretty fine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!