rem TUT3A
rem Initial settings
sync on : sync rate 100
backdrop off : hide mouse
EHP = 100
rem Load all media for game
gosub _load_game
rem Setup all objects for game
gosub _setup_game
rem TUT3B
rem Game loop
do
rem Control game elements
Load Bitmap "backdrop.bmp"
gosub _control_player
gosub _control_gunandbullet
gosub _control_enemies
rem Update screen
sync
rem End loop
loop
rem TUT3C
_control_player:
if SPACEKEY() = 1 then attack_player()
Load Bitmap "dude.bmp",2
Sprite 2,489,194,2
GET IMAGE 2,0,0,128,128
SET SPRITE 1, 1, 1
SHOW SPRITE 2
return
_control_gunandbullet:
return
_control_enemies:
return
_control_stats:
return
_setup_game:
`TEXT 600,10,Message
Load Bitmap "dudea.bmp",3
`Load Bitmap "enemy.bmp",4
`Load Bitmap "enemyhit.bmp",5
`Load Bitmap "enemymiss.bmp",6
return
_load_game:
return
FUNCTION attack_player()
Num = RND(6-1)+1
IF Num >=4 then EHP=EHP-10
ENDFUNCTION
`FUNCTION HIT()
`SHOW SPRITE ,2
`WAIT 1000
`HIDE SPRITE ,2
`ENDFUNCTION
there it is