Подправил пример. Сравнивая, найдете ошибки.
Код
#Include "fbgfx.bi"
Using FB
Dim Shared ShipSprites(4) As any Ptr ' integer не правильно!!!!!
'Dim Shared workpage As Single = 0
Screen 12,16
SetMouse 0,0,0
BLoad "SpaceShip.bmp",0
For imagepos As Integer = 1 To 4
ShipSprites(imagepos) = ImageCreate(20,20)
Get ((imagepos-1)*20,0)- Step(19,19),ShipSprites(imagepos)
Next imagepos
Type Player
x As Integer
y As Integer
Direction As Integer
Speed As Single
End Type
Dim Shared Ship As Player
Ship.x = 320
Ship.y = 240
Ship.Direction = 1
Ship.Speed = .6
Do
'ScreenSet workpage, workpage xor 1 <- не нужно, вы не используете двойную буферизацию, а используете запирание буфера с помощью ScreenLock
ScreenLock
cls
Put (Ship.x,Ship.y),ShipSprites(Ship.Direction),Trans
ScreenUnLock
Sleep 1
'workpage Xor = 1
If MultiKey(SC_W) Then
Ship.y = ship.y - ship.Speed
Ship.Direction = 1
EndIf
If MultiKey(SC_A) Then
Ship.x = ship.x - ship.Speed
Ship.Direction = 3
EndIf
If MultiKey(SC_D) Then
Ship.x = Ship.x + Ship.Speed
Ship.Direction = 2
EndIf
If MultiKey(SC_S) Then
Ship.y = Ship.y + Ship.Speed
Ship.Direction = 4
EndIf
Loop Until MultiKey(SC_ESCAPE)
End