;graphics etc
Graphics3D 1024,768,32
SetBuffer BackBuffer()
Global player,score=0,y#=.3
;enemy
enemy1=CreateCube()
PositionEntity enemy1,Rnd(-4.2,4.2),4,0
ScaleEntity enemy1,.5,.5,.5
EntityColor enemy1,Rnd(255),Rnd(255),Rnd(255)
;camera i svet
camera=CreateCamera()
light=CreateLight()
AmbientLight 0,0,0
PositionEntity camera,0,0,-5
PositionEntity light,0,5,-5
LightColor light,255,250,215
;player
player=CreateSphere(32)
ScaleEntity player,.5,.5,.5
PositionEntity player,x#,-2.5,0
;cycle
cop=0
Repeat
x#=0
l#=EntityY(enemy1)
MoveEntity enemy1,0,-y,0
If l# < -3 And cop<5
PositionEntity enemy1,Rnd(-4.2,4.2),4,0
EntityColor enemy1,Rnd(255),Rnd(255),Rnd(255)
cop=cop+1
EndIf
If KeyDown(203) =True
x#=x#-.1
MoveEntity player,x#,0,0
EndIf
If KeyDown(205)=True
x#=x#+.1
MoveEntity player,x#,0,0
EndIf
If EntityX(player) > 4.2
PositionEntity player,4.2,-2.5,0
EndIf
If EntityX(player) < -4.2
PositionEntity player,-4.2,-2.5,0
EndIf
UpdateWorld
RenderWorld
Text 10,10,cop
Flip
Until KeyHit(1)
;Найдите 10 отличий
