(http://www.underwaredesign.com/PlayBasicSig.png) (http://www.playbasic.com)
Challenge #7 - Timer Based Movement
This challenge brings up the age old chestnut of '
Timer Based Movement". For the this challenge, you'll need to implement a movement system that can control objects moving at a constant speed and direction. The positions, speed and direction should be assigned randomly when the object is spawned. The object shall die when it leaves the display completely.
The Game Clock should simulate a sync rate of 50FPS, regardless of the of speed of the machine it's running on. Each frame of the game clock (every 1000/50 milliseconds), the game should randomly spawn
one object. The spawn rate should be consistent regardless of frame rate also!
The example should not saturate the host computer when running upon faster machines.
The example should include (be based on) the following test code main loop for testing purposes. This will allow you to simulate the effect of system system upon your example.
[pbcode]
; Set PB to limit the max rate to 50 or less.
SetFPS 50
Do
Cls 0
; Update
; Output Information
print "REAL Sync Rate:"+str$(Fps())
print " MAX Sync Rate:"+str$(GetFps())
; Bump the PB sync rate up, clamp it at 100
if upkey()
Setfps GetFps()+1
endif
if downkey()
currentFPs=GetFps()
if CurrentFps
Setfps CurrentFps-1
endif
endif
; Show the Back buffer
Sync
loop
[/pbcode]
Submission * Submissions can be written in any version of PlayBasic (http://www.playbasic.com)
* Submission can only be accepted in
Source Code form only.
* Authors can use external Media (images/music) provided you created the media, have permission to use somebody else's media or the media is public domain.
*
Zip up your Submissions and please try to keep it smaller than
500K !
*
Authors automatically give consent for their submission(s) to distributed and used for promotional purposes via UnderwareDesign.com, PlayBasic code tank.
* Authors can submit as many times as they like.
* To make a submission, zip up your projects source code + media and either post it in this thread, or create your own a thread the Source Codes or Show Case forums and post a link bellow.
Dead Line Anytime before the next ice age
Return to Challenge Index (http://www.underwaredesign.com/forums/index.php?topic=3225.0)