countdown timer

Blitz3D Forums/Blitz3D Programming/countdown timer

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.

EDITT###

I fixed it... works well now... counts off the seconds (360 radius circle / 60 seconds = 6 degrees... Lookie!
; countdown clock
; by Ralph Dunn

Graphics3D 800,600,16,2
SetBuffer BackBuffer()

SeedRnd(MilliSecs())
player=CreatePivot()
camera=CreateCamera(player)
light=CreateLight()
RotateEntity light,45,45,0
AmbientLight 48,48,48    ; was 32,32,32

EntityType camera,1
PositionEntity camera,0,90,8
RotateEntity camera,90,0,0

Global clock=LoadSprite("clock1.png",4) ; essentially a circle but I made mine cool
ScaleSprite clock,8,8
Global hand=LoadSprite("clock3.png",4) ; the hand of the clock... made an arrow
ScaleSprite hand,7,7
; ##### Both images were created as PNGs with BLACK backgrounds so they would be ignored
; by Blitz3D did that for my game


PositionEntity clock,0,0,0 ; for now pop it in the middle
PositionEntity hand,0,0,0

start=MilliSecs()+1000 ; 	get initial clock value
ang=6 ; 					get initial angle to rotate hands
While Not KeyDown(1)


UpdateWorld
RenderWorld
; note where code is... I may try to function this later
Text 0,10,""+MilliSecs()
Flip

If MilliSecs() >= start Then ; check if 1 second has passed
		RotateSprite hand,ang ; if so... rotate the hand
		ang=ang+6 ;				IF ang = ang -6 clock goes other direction
		start=MilliSecs()+1000 ; get new value for checking
EndIf
	
Wend

End
I hope this helps everyone else. :]
-Rook Zimbabwe