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.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.