Sonic style platforms

BlitzMax Forums/BlitzMax Beginners Area/Sonic style platforms

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Set the Handle of the "Sonic" Sprites to the point he/she would rotate around, measure distance from this point to the bottom of the sprite and use this distance to place the sprite into the slope (lowest point when the slope wouldnt be rotated).
Or to save this time, use a really circular slope and there will be no need to calculate the lowest part of the slope-sprite the figure is walking on.

To make it also work on "hills" or other things you just calculate the angle of the point the figure is standing on (angle to horizontal line) and apply the angle to the figure the same way (handle of sprite image has to be set to the center of rotation) ... Distancecalculation is the same (handle to bottom).

If the angle is over a certain value (70° for example) you set the figure to "fall" instead to "walk"... or if its 160° you would say "block" (has to jump) ... depending on the walking direction.


bye
MB