Flickering background

BlitzMax Forums/BlitzMax Beginners Area/Flickering background

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Hi,
I have the following code which animates a sprite.I wanted to add a background using LoadImage but it continually flickers.Any suggestions why 'image' flickers ? Thanks in advance.

[/code]
Graphics 800,600 'set gfx mode
Global FrameTimer = MilliSecs()
Global frame:Int = 0
Global x:Int =0
Global myimage:TImage = LoadAnimImage("ko1.png",32,32,0,240)
Local image:TImage=LoadImage("pitch.png",flags=-1)
DrawImage image:TImage,0,0,frame
Flip
sound=LoadSound("bouncy.ogg")
PlaySound sound
Repeat
'Cls
DrawImage myimage,x,50,frame

If MilliSecs() > FrameTimer + 100
FrameTimer = MilliSecs()
frame:+1
EndIf

If frame >239 Then frame = 0

Flip
FlushMem

Until KeyHit(KEY_ESCAPE)
soundover = LoadSound ("gameover.ogg")
PlaySound soundover[/code]