`=====================
`===Alex's RPS game===
`=====================
 
 
sync on : cls : sync rate 0
ink rgb(255,255,255),0
center text 320,80,"Journey to RPS Kastle"
center text 320,100,"1.Play"
center text 320,120,"2.Help"
do
if inkey$()="1" then gosub game
if inkey$()="2" then gosub help
sync
loop
 
help:
cls
print "You must get to RPS Kastle. To do this you must win a series of Rock Paper Scissors games. Begin"
print "By choosing how many times the enemy who you are playing against will respawn. Then choose"
print "how many times you will respawn. After that you will play Rock Paper Scissors. Click on either rock,"
print "paper or scissors. If you pick the same as the enemy, nothing will happen. You will kill the en-"
print "emy if he has rock and you chose paper, he has paper and you chose scissors, or he has scissors"
print "and you have rock. He will kill you if the opposite is true. Good luck! Click to go back."
suspend for mouse
cls
center text 320,80,"Journey to RPS Kastle"
center text 320,100,"1.Play"
center text 320,120,"2.Help"
return
game:
gosub images
cls
ta:
ink rgb(255,255,255),0
input "How many times should the enemy respawn?",res
if res=0 
print "Invalid, 0 is cheating you lousy-!"
suspend for key
cls
gosub ta
endif
ta2:
input "How many times should you respawn?",yres
if yres=0 
print "Invalid, 0 is bad bad bad. Shame on you!"
suspend for key
cls
gosub ta2
endif
ink rgb(0,0,100),0
box 0,0,639,479
ink rgb(200,200,180),0
box 0,0,400,100
sprite 1,5,0,1
sprite 2,120,0,2
sprite 3,260,30,3
get image 4,400,180,500,400
 
do
gosub gl
gosub havewonorlost
sync
loop
 
havewonorlost:
if yres-deaths>0 and res-goes=0 then gosub win
if yres-deaths=0 and res-goes>0 then gosub lose
return
 
win:
cls
delete sprite 1
delete sprite 2
delete sprite 3
ink rgb(100,100,255),0
box 0,0,639,300
ink rgb(0,100,0),0
box 0,300,639,479
ink rgb(255,255,200),0
box 100,50,250,400
box 200,150,450,400
box 400,50,550,400
ink rgb(100,70,70),0
box 295,300,355,400
ink rgb(0,0,0),0
center text 320,200,"You made it to RPS Kastle!"
suspend for key
end
 
lose:
cls
delete sprite 1
delete sprite 2
delete sprite 3
ink rgb(255,0,0),0
box 100,100,500,400
for t=0 to 200
a=rnd(600)
b=rnd(400)
box a,b,a+rnd(100),b+rnd(100)
next t
blur bitmap 0,6
blur bitmap 0,6
blur bitmap 0,6
ink rgb(0,0,200),0
center text 320,200,"You lost."
suspend for key
end
 
 
gl:
set cursor 420,0
print "Enemy respawns left:",res-goes
set cursor 420,20
print "You respawns left:",yres-deaths
 
if mousex()<100 and mousey()<100 and mouseclick()=1 then chose=1 : gosub chosen
if mousex()>120 and mousex()<240 and mousey()<100 and mouseclick()=1 then chose=2 : gosub chosen
if mousex()>260 and mousex()<360 and mousey()<100 and mouseclick()=1 then chose=3 : gosub chosen
return
 
chosen:
if chose=1 then sprite 4,0,200,1
if chose=2 then sprite 4,0,200,2
if chose=3 then sprite 4,0,240,3
set text size 120
text 400,180,"3"
wait 1*1000
paste image 4,400,180
text 400,180,"2"
wait 1*1000
paste image 4,400,180
text 400,180,"1"
wait 1*1000
paste image 4,400,180
enemy=1+rnd(2)
if enemy=1 then sprite 5,300,200,1
if enemy=2 then sprite 5,300,200,2
if enemy=3 then sprite 5,300,200,3
set text size 50
if enemy=chose then center text 320,350,"Draw! Click to continue." : dnc=1
if enemy=1 and chose=2 or enemy=2 and chose=3 or enemy=3 and chose=1 then center text 320,350,"You Win! Click to continue."
if chose=1 and enemy=2 or chose=2 and enemy=3 or chose=3 and enemy=1 then center text 320,350,"You Loze! Click to continue." : deaths=deaths+1 : dnc=1
suspend for mouse
delete sprite 4
delete sprite 5
cls
ink rgb(0,0,100),0
box 0,0,639,479
ink rgb(200,200,180),0
box 0,0,400,100
if dnc=0 then goes=goes+1
if dnc=1 then dnc=0
return
 
images:
ink rgb(70,70,70),0
box 20,0,80,100
box 0,20,100,80
ink rgb(40,40,40),0
for t=0 to 500
a=rnd(100)
b=rnd(100)
box a,b,a,b
next t
ink rgb(0,0,0),0
box 0,0,20,20
box 0,80,20,100
box 80,0,100,20
box 80,80,100,100
get image 1,0,0,100,100
cls
ink rgb(255,255,255),0
box 0,0,120,100
get image 2,0,0,120,100
cls
ink rgb(180,180,180),0
for t=5 to 15
line 0,t,100,40
next t
for t=31 to 40
line 0,t,100,5
next t 
ink rgb(255,0,0),0
box 0,0,20,20
box 0,25,20,45
ink rgb(0,0,0),0
box 4,4,16,16 
box 4,29,16,41 
get image 3,0,0,100,45
return