Right my m8 came round 4 a bit the other day and tough me some simple code. Im tryin to learn some more but anyway. I've started making this little spaceship like game. Its quite simple so far ive made it so u can pick 1 of 3 ships and you can move them around the screen and make them shoot a bit.
The only problem is when I run it it says command at line 205 out of place. This command is endwhile and I don't know what to do about it.
If anyone can just take a look at it and just tell me what's wrong with it it would be much a appreciated
REM Project: space fighter
REM Created: 22/10/2007 22:52:08
REM
REM ***** Main Source File *****
REM
set image colorkey 255,0,255
load image "background.bmp",100
sprite 100,0,0,100
create animated sprite 1,"pointer.bmp",3,1,1
create animated sprite 2,"pointer red.bmp",3,1,2
create animated sprite 3,"pointer blue.bmp",3,1,3
sprite 1,screen width()/3,screen height()/2,1
sprite 2,screen width()/2,screen height()/2,1
sprite 3,screen width()/1.5,screen height()/2,1
offset sprite 1,sprite width(1)/2,sprite height(1)/2
offset sprite 2,sprite width(2)/2,sprite height(2)/2
offset sprite 3,sprite width(3)/2,sprite height(3)/2
angle=90
load image "bullet.bmp",4
missile=0
while 1 `========================================================================================================
`so you can pick a fighter to use
if started=0
repeat
if mousex()>=screen width()/3-sprite width(1)/2 and mousex()<=(screen width()/3+sprite width(1)-sprite width(1)/2) AND mousey()>=screen height()/2-sprite height(1)/2 AND mousey()<=(screen height()/2+sprite height(1)-sprite height(1)/2)
set sprite frame 1,2
if mouseclick()=1
started=1
repeat
set sprite frame 1,3
until mouseclick()=0
else
started=0
endif
else
set sprite frame 1,1
started=0
endif
if mousex()>=screen width()/2-sprite width(2)/2 and mousex()<=(screen width()/2+sprite width(2)-sprite width(2)/2) AND mousey()>=screen height()/2-sprite height(2)/2 AND mousey()<=(screen height()/2+sprite height(2)-sprite height(2)/2)
set sprite frame 2,2
if mouseclick()=1
started=2
repeat
set sprite frame 2,3
until mouseclick()=0
else
started=0
endif
else
set sprite frame 2,1
started=0
endif
if mousex()>=screen width()/1.5-sprite width(3)/2 and mousex()<=(screen width()/1.5+sprite width(3)-sprite width(3)/2) AND mousey()>=screen height()/2-sprite height(3)/2 AND mousey()<=(screen height()/2+sprite height(3)-sprite height(3)/2)
set sprite frame 2,2
if mouseclick()=1
started=3
repeat
set sprite frame 2,3
until mouseclick()=0
else
started=0
endif
else
set sprite frame 2,1
started=0
endif
`If you pick fighter one this will happen -----------------------------------------------------------------------------
if started=1
hide sprite 2
hide sprite 3
sprite 1,screen width()/2,screen height()/2,1
if rightkey()=1
angle=angle+2
endif
if leftkey()=1
angle=angle-2
endif
if upkey()=1
move sprite 1,2
endif
if downkey()=1
move sprite 1,-2
endif
`so a bullet fires
if spacekey()=1 then sprite 4,sprite x(1),sprite y(1),4 : rotate sprite 4,angle : missile=1
if missile=1
move sprite 4,2
else
if sprite exist (4)
delete sprite 4
endif
endif
rotate sprite 1,angle
endif
`for ship 2 -----------------------------------------------------------------------------------------------------
if started=2
hide sprite 1
hide sprite 3
sprite 2,screen width()/2,screen height()/2,1
if rightkey()=1
angle=angle+2
endif
if leftkey()=1
angle=angle-2
endif
if upkey()=1
move sprite 2,2
endif
if downkey()=1
move sprite 2,-2
endif
`so a bullet fires
if spacekey()=1 then sprite 4,sprite x(2),sprite y(2),4 : rotate sprite 4,angle : missile=1
if missile=1
move sprite 4,2
else
if sprite exist (4)
delete sprite 4
endif
endif
rotate sprite 2,angle
endif
`--------------------------------------------------------------------------------------------------------------------
if started=3
hide sprite 2
hide sprite 1
sprite 3,screen width()/2,screen height()/2,1
if rightkey()=1
angle=angle+2
endif
if leftkey()=1
angle=angle-2
endif
if upkey()=1
move sprite 3,2
endif
if downkey()=1
move sprite 3,-2
endif
`so a bullet fires
if spacekey()=1 then sprite 4,sprite x(3),sprite y(3),4 : rotate sprite 4,angle : missile=1
if missile=1
move sprite 4,2
else
if sprite exist (4)
delete sprite 4
endif
endif
rotate sprite 3,angle
endif
endwhile
wait key
end
Nothings impossible