FrameLimit 40
'Enable graphics commands to cast shapes to
'the game world
DrawToWorld ON
pacman=LoadObject("Media\pacman.bmp")
ObjectPickable pacman,2 'circle-pick
'Load the shooter
guy=LoadObject("Media\guy.bmp",180)
PositionObject guy,0, -100
Color cbblack
AddText "Guide via arrows"
AddText "SPACE to shoot"
ClsColor cbwhite
Repeat
'Update controls
If LeftKey() Then TurnObject guy,2
If RightKey() Then TurnObject guy, -2
If UpKey() Then MoveObject guy,2
If DownKey() Then MoveObject guy, -2
'Pick
ObjectPick guy
Color cbblack
DrawGame
'Something WAS picked, let's see what it is
e=PickedObject()
If e=pacman
Color cbred
Text 0,40,"PICK"
Text 0,50,PickedAngle()
Circle PickedX() -4,PickedY()+4,8,OFF
If KeyDown(cbkeyspace) Then
Line PickedX(),PickedY(),PickedX()+Cos(PickedAngle()+10)*20,PickedY()+Sin(PickedAngle()+10)*20
Line PickedX(),PickedY(),PickedX()+Cos(PickedAngle() -10)*20,PickedY()+Sin(PickedAngle() -10)*20
EndIf
EndIf
'draw the check-zones
Circle ObjectX(pacman) -32,ObjectY(pacman)+32,64,OFF
DrawScreen
Until EscapeKey()
|
|