If KeyDown(200) Then
deltay#=-1
deltax#=0
a=2
b=1
EndIf
If KeyDown(208) Then
deltay#=1
deltax#=0
a=2
b=1
EndIf
If KeyDown(205) Then
deltax#=1
deltay#=0
a=1
b=0
EndIf
If KeyDown(203) Then
deltax#=-1
deltay#=0
a=1
b=0
EndIf
If KeyDown(205) And KeyDown(200) Then
deltay#=-1
deltax#=1
a=5
b=2
EndIf
If KeyDown(203) And KeyDown(200) Then
deltay#=-1
deltax#=-1
a=7
b=3
EndIf
If KeyDown(205) And KeyDown(208) Then
deltay#=1
deltax#=1
a=9
b=4
EndIf
If KeyDown(203) And KeyDown(208) Then
deltay#=1
deltax#=-1
a=11
b=5
EndIf
If KeyDown(203)=0 And KeyDown(208)=0 And KeyDown(205)=0 And KeyDown(200)=0 Then
speed#=0
deltax#=0
deltay#=0
EndIf
If x#<0 Then x#=1280
If x#>1280 Then x#=0
If y#<0 Then y#=1024
If y#>1024 Then y#=0
speed#=5
x#=px#+deltax#*speed#
px#=x#
y#=py#+deltay#*speed#
py#=y#
Сделал векторное перемещение игрока, но теперь игрок может выйти за пределы экрана, то есть
If x#<0 Then x#=1280
If x#>1280 Then x#=0
If y#<0 Then y#=1024
If y#>1024 Then y#=0
не работает
Хотелось бы узнать почему?