Rotate A Sprite in Basic4GL
How to Rotate a Sprite in Basic4GL
Create the sprite, set it up.
Dim degs
degs = 0
In the game loop:
degs = degs+15
SprSetAngle(degs)
That will turn it.
Complete Code:
TextMode(TEXT_BUFFERED)
tex = LoadTexture("Data/Star.bmp")
spr = NewSprite(tex)
dim degs
Do
Cls
degs = degs+15
SprSetAngle(degs)
DrawText()
Sleep(20)
Loop
End
Save that in the Basic4GL/Programs folder. It uses artwork that comes with the installation of B4GL.
page revision: 8, last edited: 20 Apr 2014 00:22