# Skate Math

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

## 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.

##### Share on other sites
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 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.

1. 1
2. 2
Rutin
19
3. 3
khawk
15
4. 4
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633744
• Total Posts
3013652
×