hey,so i decided to add a titlescreen after i finished my game. I am using the
do
mx=mousex(): my=mousey(): mc=mouseclick()
if mc=1 then gosub checkregion
loop
checkregion:
if mx > 54 and my >86 and mx < 424 and my < 172
then rem PROBLEM IS HERE
endif
return
style to do this. but when i add this type of code to my game, the title screen shows up for only a flash before my actual game just starts playing. so i guess i have two questions: 1)how do i get the screen to not instantly disappear. 2) once the game goes to the "subroutine checkregion im not exactly show what to put in the "then" spot - do i use a "goto" to start up the main loop?
here is the actual game code. sorry its probably a complete mess.
load image "balloon.bmp",1
load image "thorn.bmp",2
load image "darts.bmp",3
load image "bullet.bmp",4
load image "wall.bmp", 5
load music "Ace Combat Zero - Zero.mp3",1
load music "Beethoven Piano Concerto no.5 op.73 Emperor - (1_4).mp3",2
load image "medal.bmp", 6
load image "spikeball.bmp",7
load image "titlescreen.jpg",8
play music 1
rem titlescreen
paste image 8,0,0
checkregion:
rem Begin button
if mx > 54 and my >86 and mx < 424 and my < 172
goto game
endif
counter=0
sprite 5,0,-4,5
rem create thorns
for x = 10 to 400
xpos=rnd(620)
ypos=5400+rnd(10000)
sprite x,xpos,ypos,2
scale sprite x, 25
next x
rem create darts
for x = 401 to 650
xpos2=rnd(620)
ypos2=800+rnd(4500)
sprite x,xpos2,ypos2,3
scale sprite x, 25
next x
for x = 651 to 750
xpos2 = rnd(620)
ypos2=5400+rnd(10000)
sprite x,xpos2,ypos2,3
scale sprite x, 25
next x
rem SPIKEBALLS
for x = 751 to 850
xpos4 = rnd(420)
ypos4 = 12000+rnd(14320)
sprite x,xpos4,ypos4,7
scale sprite x,15
next x
rem create darts SIDE WAYS
for x = 851 to 950
xpos5 = 4500+rnd(6500)
ypos5=rnd(420)
sprite x,xpos5,ypos5,3
scale sprite x,25
next x
xpos1 = 100
ypos1 = 100
sync rate 0
sync
game:
do
rem title screen
mx=mousex(): my=mousey(): mc=mouseclick()
if mc=1 then gosub checkregion
rem stars
dot rnd(640),rnd(480)
rem controls
if leftkey() <> 0 then dec xpos1,3
if rightkey() <> 0 then inc xpos1,3
if upkey() <> 0 then dec ypos1,3
if downkey() <> 0 then inc ypos1,3
sprite 1,xpos1,ypos1,1
set sprite 1,1,1
rem Balloon boundaries
if xpos1 < 1 then inc xpos1,0
if xpos1 > 620 then dec xpos1,3
if ypos1 < 1 then inc ypos1,3
if ypos1 > 450 then dec ypos1,3
REM ENDING SEQUENCE THORNS
for x = 10 to 400
move sprite x,2+rnd(3)
if sprite collision (x,5) then counter = counter + 1
if sprite collision (x,1)
hide all sprites
cls
stop music 1
print counter/30
text 50,0, "Dr. Antinous's traps dodged"
text 10, 200, "FINCH! COME IN FINCH! FINCH, DO YOU COPY!? FOLKS, I FEAR THE WORST HAS HAPPENED"
wait 5500
end
endif
set sprite x,1,1
next x
REM ENDING SEQUENCE DARTS
for x = 401 to 650
move sprite x,2+rnd(3)
if sprite collision (x,5) then counter = counter + 1
if counter = 24000
cls
stop music 1
play music 2
text 10,40, "You have saved this universe from Dr. Antinous's evil dictatorship"
text 10,80, "You have earned the highest regard this universe has to offer - the"
text 10,120, "medal of Achilles, given only to those who conquer the unconquerable"
print counter/30
text 50,0, "Dr. Antinous's traps dodged"
wait 7500
sprite 6,235,200,6
scale sprite 6, 100
wait 8000
cls
print "Made by Adam Ratajczak"
wait 25000
end
endif
if sprite collision (x,1)
hide all sprites
cls
stop music 1
print counter/30
text 50,0, "Dr. Antinous's traps dodged"
text 10, 200, "FINCH! COME IN FINCH! FINCH, DO YOU COPY!? FOLKS, I FEAR THE WORST HAS HAPPENED"
wait 5500
end
endif
set sprite x,1,1
next x
REM SEQUENCE SIDEWAYS DARTS
for x = 851 to 950
rotate sprite x, 270
move sprite x, 2+rnd(3)
if sprite collision (x,1)
hide all sprites
cls
stop music 1
print counter/30
text 50,0, "Dr. Antinous's traps dodged"
text 10, 200, "FINCH! COME IN FINCH! FINCH, DO YOU COPY!? FOLKS, I FEAR THE WORST HAS HAPPENED"
wait 5500
end
endif
set sprite x,1,1
next x
REM SPIKEBALLS
for x = 751 to 851
move sprite x,4
if sprite collision(x,5) then counter = counter + 1
if sprite collision (x,1)
hide all sprites
cls
stop music 1
print counter/30
text 50,0, "Dr. Antinous's traps dodged"
text 10, 200, "FINCH! COME IN FINCH! FINCH, DO YOU COPY!? FOLKS, I FEAR THE WORST HAS HAPPENED"
wait 5500
end
endif
set sprite x,1,1
next x
REM cheat ending
if spacekey()=1 and controlkey() =1
cls
stop music 1
play music 2
text 10,40, "You have saved this universe from Dr. Antinous's evil dictatorship"
text 10,80, "You have earned the highest regard this universe has to offer - the"
text 10,120, "medal of Achilles, given only to those who conquer the unconquerable"
print counter/30
wait 7500
sprite 6,235,200,6
scale sprite 6, 100
wait 8000
cls
wait 25000
end
endif
loop
end