Easy jump example
-
- Enthusiast
- Posts: 121
- Joined: Mon Jun 26, 2006 10:47 am
Easy jump example
if you ever wanted to make your sprite jump with simulated physics, i've whipped up a quick example here: http://www.MailFreeOnline.com/uploader/7004BA98.zip
and for the slightly more advanced user (involves platforms) -- VERY buggy, quickly done:
http://www.MailFreeOnline.com/uploader/02ABDBBE.zip
(push space bar to jump)
and for the slightly more advanced user (involves platforms) -- VERY buggy, quickly done:
http://www.MailFreeOnline.com/uploader/02ABDBBE.zip
(push space bar to jump)
Code: Select all
If OpenScreen(640, 480, 32, "Eraser")
LoadSprite(0, "Square.bmp") ;Change this to the location of your sprite
SetFrameRate(60) <------------- insert this line here
Repeat
FlipBuffers()
See the line above.

Other than that, very good. Thanks for sharing.
-
- Enthusiast
- Posts: 121
- Joined: Mon Jun 26, 2006 10:47 am
- Michael Vogel
- Addict
- Posts: 2811
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
on most systems you can leave the SetFrameRate() out,
but on some systems it will move too fast without it.
its a rough solution, but it works.
but since FlipBuffers() will use 100%CPU while waiting for the next frame,
the better solution would be to put the whole movement under time-control.
best solution would be seperate threads.
one is timer-controlled and does the movement of the objects,
a second does the display and just runs on maximum framerate, or with a little delay...
but on some systems it will move too fast without it.
its a rough solution, but it works.
but since FlipBuffers() will use 100%CPU while waiting for the next frame,
the better solution would be to put the whole movement under time-control.
best solution would be seperate threads.
one is timer-controlled and does the movement of the objects,
a second does the display and just runs on maximum framerate, or with a little delay...
oh... and have a nice day.