Ok, so I've made a new version of the script, which fixed some of my issues...
However, I'm still having two problems happen
1 : Flickering Screen.
2 : An error code saying "Unable to load image at line 5."
I'm trying to figure out what is causing the image error, and I think it has to do with the id being "0". The way the images work, is that a rnd(2) picks a number, either 0, 1, or 2, and then pastes the corresponding image. Originally, it was an rnd of 3, making it generate four numbers instead of three.
I'm wondering if there is a way to constraint the lowest random number, so I don't have to give an image an id of 0. Is there any way to do that?
Thanks!
Sync On
Sync Rate 60
Backdrop Off
load image "0.bmp",0
load image "1.bmp",1
load image "2.bmp",2
points = 0
lives = 3
MonsterGen:
monster = rnd(2)
paste image monster,200,1
sync
gosub ProblemGen
ProblemGen: aparta = rnd(50)
apartb = rnd(50)
sparta = rnd(50)
spartb = rnd(50)
mparta = rnd(50)
mpartb = rnd(10)
if monster = 1 then gosub Addition
if monster = 2 then gosub Subtraction
if monster = 3 then gosub Multiplication
return
Addition:
print sparta
print "Plus"
print spartb
print "Equals"
sync
input "My answer is ---> ",aanswer
if aanswer = aparta + apartb then gosub GetPoint
if aanswer <> aparta + apartb then gosub LooseLife
return
Subtraction:
print sparta
print "Minus"
print spartb
print "Equals"
sync
input "My answer is ---> ",sanswer
if sanswer = sparta - spartb then gosub GetPoint
if sanswer <> sparta - spartb then gosub LooseLife
return
Multiplication:
print mparta
print "Times"
print mpartb
print "Equals"
sync
input "My answer is ---> ",manswer
if manswer = mparta * mpartb then gosub GetPoint
if manswer <> mparta * mpartb then gosub LooseLife
return
GetPoint:
cls
delete image 1
delete image 2
delete image 3
points = points + 1
print "Your new score is", points
print "Press a key for the next monster."
sync
Wait Key
cls
if points = 20 then gosub Win
gosub MonsterGen
return
LooseLife:
cls
delete image monster
lives = lives - 1
print "Oops! You lost a life! Your current health is now", lives
print "Press a key for the next monster."
sync
Wait Key
cls
if lives = 0 then gosub Loose
gosub MonsterGen
return
Win:
print "C O N G R A T U L A T I O N S !"
print "You beat all the monsters!"
print "If you want to play again, please restart the game."
Wait Key
exit
return
Loose:
print "O H N O !"
print "You have fallen to the monsters."
print "If you want to play again, please restart the game."
Wait Key
exit
return
AndRaxius - still a piece of human garbage.