я решил создать свою 2д игру, и чет пока ничего особо не получается. хочу сделать игру отдалённо похожую на гта1. наработки уже есть. и сразу же появилась проблема(я не мастер программирования) надо сделать так, чтобы чел не проходил сквозь здания.
вот код игры:
Graphics 800,600,32,1
Global x=100
Global y=100
Global speed=4
SetBuffer BackBuffer()
Global player=LoadImage("1.bmp")
Global ground=LoadImage ("ground1.bmp")
Global house1=LoadImage ("house1.bmp")
;;Global mouseimage = LoadImage("cursor.bmp")
;;DrawImage mouseimage,MouseX(),MouseY()
;;Delay 20
;;HandleImage mouseimage,0,0
DrawImage player,x,y
MidHandle player
MaskImage player,0,0,10
DrawImage player,x,y
DrawImage ground,0,0
Function updateplayer()
DrawImage player,x,y
If ImagesCollide(player,x,y,0,house1,300,400,0) Then speed=0
If KeyDown(200)
y=y-speed
DrawImage player,x,y
EndIf
If KeyDown(208 )
y=y+speed
DrawImage player,x,y
EndIf
If KeyDown(205)
x=x+speed
DrawImage player,x,y
EndIf
If KeyDown(203)
x=x-speed;1,
DrawImage player,x,y
EndIf
End Function
While Not KeyDown(1)
updateplayer()
Flip
Cls
DrawImage ground,0,0
DrawImage house1,300,400
;If ImagesCollide Then speed=0
Wend
и чел немного заходит в дом, а назад никак. подскажите, плз!!!