1st half of code
currentlevel = 1
blocks = 10
addblock = 0
removeblock = 0
leftright = 10
leftorright = 0
RandomBattle = 0
hp = 10
enemyhp = 999999
enemyDmg = 5
dmg = 2
turntimer = 200
lost = 500
maxhp = 10
regenerate = 0
exp = 0
level = 1
expneeded = 200
dmgboost = 1
wichdmgboost = 0
score = 0
randomenemy = 0
losta = true
switch = false
space = false
IfInBattle = false
RCOFB = false
bswitch = true
aswitch = true
atext = "welcome to the game"
itemisthere = 1
itemisthere2 = 1
itemisthere3 = 1
function setup()
end
function draw()
if(currentlevel<=3)then
background(31, 116, 33, 255)
end
if(currentlevel==3)then
background(30, 30, 30, 255)
end
if(currentlevel==4)then
background(23, 23, 23, 255)
end
if(currentlevel >= 100)then
background(81, 81, 81, 255)
end
if(currentlevel <99)then
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("xp:",700,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 51, 255, 255)
text(exp,800,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("/",880,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 55, 255, 255)
text(expneeded,970,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(84, 27, 144, 255)
text(level,200,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("level:",100,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("hp:",800,100)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(173, 31, 31, 255)
text(hp,900,100)
end
wichdmgboost = math.random(1,3)
if(wichdmgboost == 3)then
dmgboost = 1
else
dmgboost = 0
end
if(exp >= expneeded)then
if(IfInBattle == false)then
exp = exp-expneeded
expneeded = expneeded+200
maxhp = maxhp+2
level = level+1
hp = maxhp
dmg = dmg+1
end
end
if(regenerate == 27)then
hp = hp+1
regenerate = 0
end
if(hp >= maxhp)then
hp = maxhp
end
if(switch == true)then
leftright = 10
blocks = 10
switch = false
end
if(currentlevel <=98)then
end
parameter.action("go up",addblocks)
parameter.action("go right",left)
parameter.action("go down",removeblocks)
parameter.action("go left",right)
if(addblock == 1)then
if(blocks<=18)then
blocks = blocks+1
end
addblock = 0
end
if(removeblock == 1)then
if(blocks >= 3)then
blocks = blocks-1
end
removeblock = 0
end
--levels--
--level1--
if(currentlevel == 1)then
sprite("Planet Cute:Character Boy",leftright*50,blocks*50)
sprite("Planet Cute:Character Pink Girl",15*50,7*50)
sprite("Planet Cute:Rock",12*50,14*50)
sprite("Planet Cute:Wall Block Tall",8*50,15*50)
sprite("Planet Cute:Shadow South",8*50,15*50-80)
sprite("Planet Cute:Character Horn Girl",8*50,15*50+80)
sprite("Planet Cute:Tree Tall",4*50,5*50)
--sprite("Dropbox:Swordsmall",leftright*50-70,blocks*50+60)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(84, 27, 144, 255)
text(level,200,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("level:",100,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("hp:",800,100)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(173, 31, 31, 255)
text(hp,900,100)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("xp:",700,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 51, 255, 255)
text(exp,800,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("/",880,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 55, 255, 255)
text(expneeded,970,1000)
if(itemisthere == 1)then
sprite("Space Art:Part Green Wing 4",15*50,11*50)
end
if(itemisthere3 == 1)then
sprite("Space Art:Part Green Hull 5",7*50,5*50)
end
end
--level2
if(currentlevel ==2)then
sprite("Planet Cute:Rock",9*50,15*50)
sprite("Planet Cute:Character Boy",leftright*50,blocks*50)
--sprite("Dropbox:Swordsmall",leftright*50-70,blocks*50+60)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(84, 27, 144, 255)
text(level,200,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("level:",100,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
text("hp:",800,100)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(174, 22, 22, 255)
text(hp,900,100)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("xp:",700,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 51, 255, 255)
text(exp,800,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("/",880,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 55, 255, 255)
text(expneeded,970,1000)
if( itemisthere2== 1)then
sprite("Space Art:Part Green Wing 4",6*50,12*50)
end
if(itemisthere == 0)then
if(itemisthere2 ==0)then
if(itemisthere3 == 0)then
sprite("Space Art:Green Ship",11*50,9*50)
end
end
end
end
--level3--
if(currentlevel == 3)then
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(84, 27, 144, 255)
text(level,200,1000)
font("AmericanTypewriter-Bold")
fontSize(60)
textWrapWidth(800)
fill(0, 0, 0, 255)
text("level:",100,1000)