well this might seem like a very newbie question... but I just started 2 days ago with some book I bought.
Graphics 300,400,0,2
Type luis
Field x,y
Field image
Field dirx
End Type
Global player.luis = New luis
player\image = LoadImage ("pingui.bmp")
ScaleImage player\image,.20,.20
While Not KeyDown(1)
Cls
DrawImage player\image,player\x,player\y
testpingui()
player\x = player\x + player\dirx
Flip
Wend
Function testpingui()
player\x = 100
player\y = 100
player\dirx = Rand (-1,1)
If player\x < 0 Or player\x > 290
player\dirx = -player\dirx
EndIf
End Function
All i want is to make this image move right and left , and when it gets out of screen , reverse direction, but all i get is the image shaking or something , whats up with that!!! any help plz.
Graphics 300,400,0,2
Type luis
Field x,y
Field image
Field dirx
End Type
Global player.luis = New luis
player\image = LoadImage ("pingui.bmp")
ScaleImage player\image,.20,.20
While Not KeyDown(1)
Cls
DrawImage player\image,player\x,player\y
testpingui()
player\x = player\x + player\dirx
Flip
Wend
Function testpingui()
player\x = 100
player\y = 100
player\dirx = Rand (-1,1)
If player\x < 0 Or player\x > 290
player\dirx = -player\dirx
EndIf
End Function
All i want is to make this image move right and left , and when it gets out of screen , reverse direction, but all i get is the image shaking or something , whats up with that!!! any help plz.