Graphics 0,0,32,1
SetBuffer BackBuffer()
Type player
Field x,px,deltax
Field y,py,deltay
End Type
Global dmgC#
Global x=100
Global y=100
Global speed#=3
Global zdorov#=100
Global speedc#=5
Global hp100=LoadImage("hp100.bmp")
Global hp80=LoadImage("hp80.bmp")
Global hp60=LoadImage("hp60.bmp")
Global hp40=LoadImage("hp40.bmp")
Global hp20=LoadImage("hp20.bmp")
Global cursor=LoadImage("cursor.bmp")
Global polosa=LoadImage("polosa.bmp")
Global Endd=LoadImage("end.bmp")
Global player=LoadImage("1.bmp")
Global ground=LoadImage ("ground1.bmp")
Global house1=LoadImage ("house1.bmp")
Global bot=LoadImage("bot.bmp")
Global car=LoadImage("car1.bmp")
Global cy=Rand(1366)
MaskImage hp100,255,255,255
MaskImage hp80,255,255,255
MaskImage hp60,255,255,255
MaskImage hp40,255,255,255
MaskImage hp20,255,255,255
MaskImage player,0,0,10
TileImage ground,0,0,0
Function updateplayer()
DrawImage player,x,y
MidHandle player
DrawImage player,x,y
DrawImage ground,0,0
DrawImage house1,300,400
DrawImage car,555,cy
f=LoadFont ("courier",40,False,False,False)
MaskImage cursor,255,255,255
px=x+speed*deltax
py=y+speed*deltay
DrawImage player,x,y
If x<0 Then x = 1366
If x>1366 Then x = 0
If y<0 Then y = 768
If y>768 Then y = 0
cursorX=MouseX()
cursorY=MouseY()
DrawImage cursor,MouseX(),MouseY()
px=x+speed#*deltax
py=y+speed#*deltay
If KeyDown(200) Or KeyDown(17) Then
y=y-speed
EndIf
If KeyDown(20
Or KeyDown(31)
y=y+speed
EndIf
If KeyDown(203) Or KeyDown(30)
x=x-speed
EndIf
If KeyDown(205) Or KeyDown(32)
x=x+speed
EndIf
If ImagesCollide(player,x,y,0,car,555,cy,0) Then zdorov#=zdorov#-2
If zdorov#>80 And zdorov#=<100 Then DrawImage hp100,5,5
If zdorov#>60 And zdorov#=<80 Then DrawImage hp80,5,5
If zdorov#>40 And zdorov#=<60 Then DrawImage hp60,5,5
If zdorov#>20 And zdorov#=<40 Then DrawImage hp40,5,5
If zdorov#>0 And zdorov#=<20 Then DrawImage hp20,5,5
If zdorov#<0 Then DrawImage endd,0,0
End Function
While Not KeyDown(1)
updateplayer()
Flip
Cls
DrawImage polosa,538,83
If 1=1 Then cy=cy+speedc#
If cy<0 Then cy = 768
If cy>768 Then cy = 0
If ImagesCollide(polosa,538,86,0,car,555,cy,0) Then speedc#=1
If Not ImagesCollide(polosa,538,86,0,car,555,cy,0) Then speedc#=5
Wend
End