added label and data statement.
sync on
sync
sync rate 0
hide mouse
disable systemkeys
print "Space Invaders"
print "by:idiotic people"
print "(press any key to continue...)"
sync
wait key
cls
box 13, 1, 17, 12
box 1, 12, 30, 30
get image 1, 1, 1, 30, 30, 1
Sprite 1,-50,0,1
Set Sprite Diffuse 1,0,0,100
Type alien
xPos As Float
yPos As Float
color As DWord
firerate As Byte
MoveSpeed As Byte
EndType
ExitToMenu:
playerx = 320
playery = 400
NumOfAlienCols = 10
NumOfAlienRows = 5
Dim Enemies(NumofAlienRows, NumofAlienCols) As Alien
For row = 1 To NumOfAlienRows
For col = 1 To NumOfAlienCols
Next col
Next row
barrier1X=140
barrier1Y=310
barrier2X=300
barrier2Y=310
barrier3X=480
barrier3Y=310
fire = 0
score = 0
level = 1
lives = 3
timerFire=timer()
menu()
repeat
if not fire
if spacekey()
endif
else
endif
if keystate(203) = 1 then playerx=playerx-1
if keystate(205) = 1 then playerx=playerx+1
if playerx < 30 then playerx = 30
if playerx > 580 then playerx = 580
if keystate(57) = 1 and firekey = 0 then firekey = 1
if keystate(57) = 0 and firekey = 1 then firekey = 0
if escapekey() = 1 then goto ExitToMenu
sprite 1, playerx, playery, 1
sync
cls
until lives = 0
print "Game over"
print "Your score : " + str$(score)
print "Press spacebar to go to THE menu, any other key to exit (and why would you want to do that?)"
sync
wait key
if spacekey() = 1 then goto ExitToMenu else end
function menu()
print "1.Start Game"
print "2.Load Game"
print "3.Help"
print "4.Exit"
if inkey$()="1" then goto startgame
if inkey$()="2" then goto loadgame
endfunction
AlienAnimFrames:
data 0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,1