FrameLimit 40 'limit game speed
fireball1=LoadObject("Media\fireball.bmp",18)
fireball2=LoadObject("Media\fireball.bmp",18)
fireball3=LoadObject("Media\fireball.bmp",18)
fireball4=LoadObject("Media\fireball.bmp",18)
car=LoadObject("Media\car.bmp",72)
Color cbblue
AddText "Arrows to turn"
ClsColor cbdarkblue
Repeat
'Update controls
If LeftKey() Then TurnObject car,5
If RightKey() Then TurnObject car, -5
If UpKey() Then MoveObject car,2
If DownKey() Then MoveObject car, -2
'Move all fireballs to the same position as the car
CloneObjectPosition fireball1,car
CloneObjectPosition fireball2,car
CloneObjectPosition fireball3,car
CloneObjectPosition fireball4,car
'Rotate all fireballs to the same angle as the car
CloneObjectOrientation fireball1,car
CloneObjectOrientation fireball2,car
CloneObjectOrientation fireball3,car
CloneObjectOrientation fireball4,car
'Move them all to their own places
MoveObject fireball1,34, -20
MoveObject fireball2,34,20
MoveObject fireball3, -34, -20
MoveObject fireball4, -34,20
'Update angle
angle=WrapAngle(angle+20)
'Rotate all fireballs
RotateObject fireball1,angle
RotateObject fireball2,angle
RotateObject fireball3,angle
RotateObject fireball4,angle
DrawScreen
Until EscapeKey()
|
|