Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --very very little adventure
- --by tetsuro -up:00/00/00
- --start:10/12/16 - end:30/12/16
- hero ={
- x = 0,
- y = 0,
- start = 0,
- mirror = false,
- anim = "standnu",
- standnu = {f=28,st=28,sz=2,spd=1/15},
- anim = "walknu",
- walknu = {f=12,st=12,sz=2,spd=1/10},
- anim = "walk",
- walk = {f=1,st=1,sz=2,spd=1/10},
- anim = "stand",
- stand = {f=17,st=17,sz=2,spd=1/15}
- }
- song={}
- song.fx={}
- song.fx.armor=false
- song.fx.door=false
- old={x=35,y=80} --old man
- sold={x=56,y=80} -- soldier
- boss={x=80,y=104}
- prin={x=100,y=112} --princess royalroom()
- pix={x=60,y=60}
- lvl = 0
- coin={x=0,y=0,up=0}
- loop = true --loop of house
- looptower = false
- looproyal = false
- looptext = false --ending message
- nude = true
- test = false
- counthouse = 0 --bubble()
- countold = 0 --bubble()
- countsold = 0 --bubble()
- countsoldier = 0 --bubble()/screen()
- countprin = 0 --bubble()/royalroom()
- oldanim = 0 --bubble()
- arrow = 0 --househero()
- soldier = false
- seller={x=29,y=48} --intower
- selleranim = 0 --in tower
- countsel = 0 --in tower
- bossdead = false --royalroom()
- cloud={x=128,y=10,spd=1}
- cloud2={x=199,y=22,spd=1}
- cloud3={x=143,y=35,spd=0.5}
- cloud4={x=201,y=42,spd=0.5}
- key = false
- key2 = false --in tower
- chest = false
- bluetile = false --getcoin()
- bluetile2 = false --getcoin()
- bluetile3 = false --getcoin()
- bluetile4 = false --intower()
- questsoldier = false --bubble()/screen()
- ladder = false --ladders()/move()
- lad = {}
- lad.x = {}
- lad.x.l = 0
- lad.x.r = 0
- lad.y = {}
- lad.y.up = 0
- lad.y.dow = 0
- -------------------------------
- function bubble()
- --auto exec
- counthouse +=1
- if(lvl==0 and counthouse >60
- and counthouse <180) then
- spr(198,hero.x,hero.y-16,2,2,palt(0,true))--bubble
- spr(201,hero.x+4,hero.y-13,1,1,palt(0,true))--?
- end
- --blocked if nude
- if(lvl==2 and nude== true
- and hero.x==30) then
- hero.x -=1
- end
- --old anim
- if(lvl==2 and hero.x>20 and
- hero.x<30) then
- oldanim +=1
- if(oldanim>30 and oldanim<60) then
- spr(3,old.x,old.y,palt(0,true))
- end
- if(oldanim>60 and oldanim<90) then
- spr(3,old.x,old.y,palt(0,true))
- oldanim = 0
- end
- end
- --old bubble if nude
- if(lvl==2 and nude==true
- and hero.x>20 and hero.x<30) then
- countold +=1
- if(countold<90) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(200,40,65,1,1,palt(0,true))--!
- end
- if(countold>90
- and countold<180) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(216,40,65,1,1,palt(0,true))--!
- end
- if(countold>180
- and countold<270) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(217,40,65,1,1,palt(0,true))--!
- end
- end
- if(countold==360) countold=0
- if(hero.x<20) countold=0
- if(countold==1 and countold<360) sfx(6)
- --old bubble if armor
- if(lvl==2 and nude==false
- and hero.x>20 and hero.x<30) then
- countold +=1
- if(countold<90) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(39,39,64,1,1,palt(0,true))--key
- end
- if(countold>90
- and countold<180) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(202,40,65,1,1,palt(0,true))--mini tower
- end
- if(countold>180
- and countold<270) then
- spr(198,36,63,2,2,palt(0,true))--bubble
- spr(14,39,65,1,1,palt(0,true))--princess
- end
- end
- if(countold==360) countold=0
- if(hero.x<20) countold=0
- --soldier bubble start
- if(questsoldier== false) then
- if(lvl==3 and hero.x>50
- and hero.x<62) then
- countsold +=1
- if(countsold<270) then
- spr(198,61,64,2,2,palt(0,true))--bubble
- spr(218,66,66,1,1)--x3
- spr(203,60,65,1,1)--coin
- end
- end
- if(countsold==360) countsold=0
- if(hero.x<20) countsold=0
- if(countsold==1 and countsold<360) sfx(6)
- end
- --princess eternal bubble :)
- if(lvl==3 and bossdead==true) then
- countprin +=1
- if(countprin>1) then
- spr(198,prin.x,prin.y-16,2,2,palt(0,true))--bubble
- spr(204,prin.x+3,prin.y-14,1,1,palt(0,true))--hearth
- end
- end
- end
- -------------------------------
- function scroll()
- spr(9,cloud.x,cloud.y,2,1,1,palt(0,true))
- spr(9,cloud2.x,cloud2.y,2,1,1,palt(0,true))
- spr(9,cloud3.x,cloud3.y,2,1,palt(0,true))
- spr(9,cloud4.x,cloud4.y,2,1,palt(0,true))
- cloud.x -= cloud.spd
- cloud2.x -= cloud2.spd
- cloud3.x -= cloud3.spd
- cloud4.x -= cloud4.spd
- if(cloud.x==-16) cloud.x = 128
- if(cloud2.x==-16) cloud2.x =140
- if(cloud3.x==-16) cloud3.x = 128
- if(cloud4.x==-16) cloud4.x =140
- end
- -------------------------------
- function testmove()
- --if hero is nude
- if(nude==true) movenude()
- --if hero get armor he's not nude
- if(lvl==0 and hero.x==75
- and loop==true) then
- nude = false
- if(song.fx.armor==false) then
- sfx(5)
- song.fx.armor = true
- end
- end
- --if hero get armor she disappears
- if(nude==false and loop==true) then
- spr(85,72,80,2,1)
- end
- --if hero get armor start move function
- if(nude==false) move()
- end
- -------------------------------
- function movenude()
- if(btn(0)) then --left move
- hero.x -= 1
- hero.mirror = true
- spr(anim(hero.walknu),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- elseif(btn(1)) then --right move
- hero.x += 1
- hero.mirror = false
- spr(anim(hero.walknu),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- elseif(btn(2)) then --up
- spr(45,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- elseif(btn(3)) then --down
- spr(44,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- elseif(btn(4)) then --attack
- spr(31,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- else --stand
- spr(anim(hero.standnu),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- end
- end
- -------------------------------
- function move()
- if(ladder==false) then
- --left
- if(btn(0)) then
- hero.x -= 1
- hero.mirror = true
- spr(anim(hero.walk),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- --right
- elseif(btn(1)) then
- hero.x += 1
- hero.mirror = false
- spr(anim(hero.walk),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- --up
- elseif(btn(2)) then
- spr(32,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- --down
- elseif(btn(3)) then
- spr(16,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- --attack
- elseif(btn(4)) then
- spr(48,hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- --stand
- else
- spr(anim(hero.stand),hero.x,hero.y,1,1,hero.mirror,palt(0,true))
- end
- end
- end
- -------------------------------
- function anim(h) -- h = hero.walk variable copy
- h.f += h.spd
- if (h.f >= h.st + h.sz) then
- h.f = h.st
- end
- return flr(h.f)
- end
- -------------------------------
- function heroxy()
- --colisions
- if(lvl==0 and hero.x==7) hero.x+=1
- if(lvl==4 and hero.x==113) hero.x-=1
- --position de depart
- if(lvl==0 and hero.start==0) then
- hero.x = 21
- hero.y = 80
- hero.start += 1
- end
- --boucle deplacements hero
- if(hero.x > 128) then
- hero.x = 0
- lvl += 1
- end
- if(hero.x < 0) then
- hero.x = 128
- lvl -= 1
- end
- --
- end
- -------------------------------
- function screen()
- --house beggin
- if(lvl==0) map(0,0,0,0,16,16)
- --nature
- if(lvl==1) then
- map(16,0,0,0,16,16)
- end
- --village
- if(lvl==2) then
- map(32,0,0,0,16,16)
- spr(4,old.x,old.y,palt(0,true))
- end
- --tower (1)
- if(lvl==3) then
- map(48,0,0,0,16,16)
- spr(19,sold.x,sold.y,2,1,palt(0,true))
- --move soldier
- if(lvl==3 and coin.up==3
- and hero.x>59 and hero.x<68
- and countsoldier<15) then
- sold.x +=1
- countsoldier +=1
- questsoldier = true
- if(countsoldier==15) then
- coin.up = 0
- end
- end
- end
- --tower (2)
- --nature flowers
- if(lvl==4) then
- map(80,0,0,0,16,16)
- end
- --nature collisions floor 1
- if(lvl==4
- and hero.x<40 and hero.y==48) then
- hero.x +=1
- end
- if(lvl==4
- and hero.x>112 and hero.y==48) then
- hero.x -=1
- end
- --nature collisions floor 2
- if(lvl==4
- and hero.x<24 and hero.y==8) then
- hero.x +=1
- end
- if(lvl==4
- and hero.x>112 and hero.y==8) then
- hero.x -=1
- end
- end
- -------------------------------
- function tests()
- if(btn(4)) test = true
- spr(11,pix.x,pix.y)
- print("test:"..(test and 'true' or 'false'),10,10,8)
- print("x:"..pix.x,10,16,10)
- print("y:"..pix.y,10,22,10)
- print("hero.start:"..hero.start,10,29,11)
- print("lvl:"..lvl,10,36,7)
- if(btn(0)) pix.x -= 1
- if(btn(1)) pix.x += 1
- if(btn(2)) pix.y -= 1
- if(btn(3)) pix.y += 1
- if(btn(5)) test = false
- if(btnp(5)) lvl +=1
- if(lvl==5) lvl = 0
- end
- -------------------------------
- function househero()
- -- window
- if(lvl==0) then
- spr(174,60,65,2,2,palt(0,true))
- end
- -- door
- if(lvl==0) then
- spr(106,44,72,2,2,palt(0,true))
- end
- --anim arrow up
- if(lvl==0 and hero.x>=45
- and hero.x<=51) then
- arrow += 1
- if(arrow<15) spr(91,49,77,1,1)--arrow 91
- if(arrow>30) arrow = 0
- end
- --enter in house
- if(lvl==0 and hero.x>=45
- and hero.x<=51 and btn(2)) then
- loop = true
- sfx(7)
- end
- --display interior house
- if(loop==true) then
- --wall collisions
- if(hero.x<17) hero.x +=1
- if(hero.x>79) hero.x -=1
- -- interior of house
- map(2,16,16,16,9,9)
- spr(37,19,80,2,1,palt(0,true))--bed
- spr(42,60,80,1,1,palt(0,true))--table
- if(nude==true) spr(8,75,80,1,1,palt(0,true))--armor
- spr(43,47,41,1,1,palt(0,true))--lamp
- spr(30,30,70,1,1,palt(0,true))--frame
- spr(93,44,72,2,2,palt(0,true))--transparent door
- --anim arrow down
- if(lvl==0 and hero.x>=45
- and hero.x<=51) then
- arrow += 1
- if(arrow<15) spr(92,49,89,1,1)--arrow 91
- if(arrow>30) arrow = 0
- end
- --exit to house
- if(lvl==0 and hero.x>=45
- and hero.x<=51 and btn(3)) then
- loop = false
- sfx(7)
- end
- end
- bubble()
- end
- -------------------------------
- function housevillage()
- --exterior door
- if(lvl==2) then
- spr(106,80,72,2,2,palt(0,true))
- end
- --anim arrow up
- if(lvl==2 and hero.x>=80
- and hero.x<=90) then
- arrow += 1
- if(arrow<15) spr(91,85,77,1,1)--arrow 91
- if(arrow>30) arrow = 0
- end
- --contidion to enter house
- if(lvl==2 and hero.x>=80
- and hero.x<=90 and btn(2)) then
- loopvillage = true
- sfx(7)
- end
- --in house
- if(loopvillage==true) then
- if(hero.x < 57) hero.x +=1
- if(hero.x > 103) hero.x -=1
- map(39,16,56,24,7,8)
- spr(23,60,80,1,1,1,palt(0,true))--chest
- spr(93,80,72,2,2,palt(0,true))--transparent door
- --open chest and get key
- if(hero.x==64 and key==false) then
- chest = true
- key = true
- sfx(3)
- end
- if(chest==true) spr(24,60,80,1,1,1,palt(0,true))--chest open
- --anim arrow down
- if(lvl==2 and hero.x>=80
- and hero.x<=90) then
- arrow += 1
- if(arrow<15) spr(92,85,89,1,1)--arrow 91
- if(arrow>30) arrow = 0
- end
- end
- --exit from house
- if(lvl==2 and hero.x>=80
- and hero.x<=90 and btn(3)) then
- loopvillage = false
- sfx(7)
- end
- end
- -------------------------------
- function intower()
- --to enter in tower
- if(lvl==3 and hero.x>=55
- and hero.x<=72 and hero.y==80
- and btn(2) and key==true
- and questsoldier==true
- and looptower==false) then
- looptower = true
- hero.x = 60
- hero.y = 112
- bluetile4 = true
- sfx(7)
- music(9)
- end
- --anim arrow up
- if(lvl==3 and hero.x>=58
- and hero.x<=69 and coin.up==1) then
- arrow += 1
- if(arrow<15) spr(91,61,74,1,1)--arrow up
- if(arrow>30) arrow = 0
- end
- --display interior tower
- if(looptower==true) then
- --wall collisions
- --floor 1
- if(hero.x<25 and hero.y==112) hero.x +=1
- if(hero.x>94 and hero.y==112) hero.x -=1
- --floor 2
- if(hero.x<25 and hero.y==80) hero.x +=1
- if(hero.x>94 and hero.y==80) hero.x -=1
- --floor 3
- if(hero.x<25 and hero.y==48) hero.x +=1
- if(hero.x>94 and hero.y==48) hero.x -=1
- --floor 4
- if(hero.x<25 and hero.y==16) hero.x +=1
- if(hero.x>94 and hero.y==16) hero.x -=1
- --floor 4 bis
- if(hero.x<2 and hero.y==0) hero.x +=1
- if(hero.x>24 and hero.y==0) hero.x -=1
- --interior tower
- map(64,0,0,0,16,16)
- spr(139,56,104,2,2,palt(0,true))--transparent door
- spr(144,56,8,2,2,palt(0,true))--red door
- spr(180,seller.x,seller.y,1,1,palt(0,true))--seller
- --seller anim
- if(lvl==3 and hero.x>24 and
- hero.x<45 and hero.y==48) then
- spr(180,seller.x,seller.y,palt(0,true))
- end
- if(lvl==3 and hero.x>24 and
- hero.x<45 and hero.y==48) then
- selleranim +=1
- if(selleranim>30 and selleranim<60) then
- spr(181,seller.x,seller.y,palt(0,true))
- end
- if(selleranim>60 and selleranim<90) then
- spr(181,seller.x,seller.y,palt(0,true))
- selleranim = 0
- end
- end
- --seller bubble
- if(lvl==3 and hero.y==48
- and hero.x>24 and hero.x<45) then
- countsel +=1
- if(countsel<90) then
- spr(198,30,32,2,2,palt(0,true))--bubble
- spr(39,33,33,1,1,palt(0,true))--key
- if(key2==true) then
- spr(177,34,34,1,1,palt(0,true))--mini door
- end
- end
- if(countsel>90
- and countsel<180) then
- spr(198,30,32,2,2,palt(0,true))--bubble
- spr(219,35,34,1,1,palt(0,true))--x1
- spr(203,29,33,1,1,palt(0,true))--coin
- if(key2==true) then
- spr(178,35,34,1,1,palt(0,true))--x1
- spr(220,29,33,1,1,palt(0,true))--white coin
- spr(177,34,34,1,1,palt(0,true))--mini door
- end
- end
- end
- if(countsel==270) countsel=0
- if(hero.x<20) countsel=0
- if(countsel==1 and countsel<270) sfx(6)
- --buy key to seller
- if(lvl==3 and hero.x>24 and
- hero.x<45 and hero.y==48
- and coin.up==1) then
- key2 = true
- coin.up = 0
- end
- --enter in royal room
- if(lvl==3 and btn(2)
- and hero.x>=59 and hero.x<=68
- and hero.y==16 and key2==true) then
- looptower = false
- looproyal = true
- --new position hero in royal room
- hero.x = 60
- hero.y = 112
- sfx(7)
- music(10)
- end
- --anim key up royal door
- if(lvl==3 and hero.x>=58
- and hero.x<=69 and hero.y==16
- and key2==false) then
- arrow += 1
- if(arrow<15) spr(162,60,4,1,1,palt(0,true))--key2 up
- if(arrow>30) arrow = 0
- end
- --anim arrow down
- if(lvl==3 and hero.x>=58
- and hero.x<=69
- and hero.y==112) then
- arrow += 1
- if(arrow<15) spr(92,61,121,1,1)--arrow 91
- if(arrow>30) arrow = 0
- end
- --to exit tower
- if(lvl==3 and hero.x>=55
- and hero.x<=72 and hero.y==112
- and btn(3)) then
- looptower = false
- hero.x = 60
- hero.y = 80
- sfx(7)
- end
- end
- end
- -------------------------------
- function royalroom()
- if(looproyal==true) then
- map(96,0,0,0,16,16,palt(0,true))
- spr(14,prin.x,prin.y,1,1,palt(0,true))--princess
- -- spr(93,56,104,2,2,palt(0,true))--transparent door
- --music(10)
- --walls collisions
- if(hero.y==112 and hero.x<2) then
- hero.x +=1
- end
- if(hero.y==112 and hero.x>118) then
- hero.x -=1
- end
- --to exit royal room
- -- if(lvl==3 and btn(3)
- -- and hero.x>=59 and hero.x<=68
- -- and hero.y==112) then
- -- looproyal = false
- -- looptower = true
- -- hero.x = 60
- -- hero.y = 16
- -- end
- --anim arrow down
- -- if(lvl==3 and hero.x>=59
- -- and hero.x<=68
- -- and hero.y==112) then
- -- arrow += 1
- -- if(arrow<15) spr(92,61,121,1,1)--arrow 91
- -- if(arrow>30) arrow = 0
- -- end
- --boss fight
- spr(141,boss.x,boss.y,2,2,palt(0,true))
- if(hero.x>=79 and hero.y==112
- and btn(4) and bossdead==false) then
- bossdead = true
- sfx(10)
- music(8)
- end
- --the end
- if(bossdead==true) then
- boss.y -= 5
- hero.x = 80
- prin.x -= 1
- --
- function heroend()
- spr(153,72,112,1,1)--wall
- spr(153,80,112,1,1)--wall
- spr(1,80,112,1,1)--hero
- end
- --princess reposition
- if(prin.x==86) then
- prin.x = 86
- prin.x +=1
- end
- --display end text message
- if(boss.y==-16) looptext = true
- if(looptext==true) then
- map(1,49,8,37,14,5,palt(0,false))
- print("thank you for playing !",19,44,15)
- print("the end...",47,55,10)
- print("code/graphic/sound-tetsuro",12,66,6)
- end
- end
- if(bossdead==false
- and hero.x==80) then
- hero.x -= 1
- end
- --
- --
- end
- end
- -------------------------------
- function getcoin()
- --paste coins
- if(lvl==4) then
- spr(7,112,80,palt(0,true))
- spr(7,34,8,palt(0,true))
- spr(7,96,48,palt(0,true))
- end
- --get coin 1
- if(lvl==4 and bluetile==false
- and hero.x==112 and hero.y==80) then
- coin.up +=1
- bluetile = true
- sfx(4)
- end
- --get coin 2
- if(lvl==4 and bluetile2==false
- and hero.x==34 and hero.y==8) then
- coin.up +=1
- bluetile2 = true
- sfx(4)
- end
- --get coin 3
- if(lvl==4 and bluetile3==false
- and hero.x==96 and hero.y==48) then
- coin.up +=1
- bluetile3 = true
- sfx(4)
- end
- --get secret coin in tower
- if(lvl==3 and coin.up==0
- and hero.x==3 and hero.y==0) then
- coin.up = 1
- sfx(4)
- end
- --paste blue tile 1
- if(lvl==4 and bluetile==true) then
- spr(51,112,80)
- end
- --paste blue tile 2
- if(lvl==4 and bluetile2==true) then
- spr(51,34,8)
- end
- --paste blue tile 3
- if(lvl==4 and bluetile3==true) then
- spr(51,96,48)
- end
- end
- -------------------------------
- function hud()
- spr(7,2,0,palt(0,true))--coin
- print(coin.up,11,3,10)--counter coins
- if(key==true) spr(39,2,7,1,1,palt(0,true))--key
- --paste blue tile 4 for key2
- if(bluetile4==true) then
- spr(51,3,9)
- end
- --key 2
- if(key2==true) spr(39,2,9,1,1,palt(0,true))--key2
- end
- -------------------------------
- function ladders()
- --house ladder lvl 0 (for tests)
- -- if(lvl==0) then
- -- lad.x.l = 95
- -- lad.x.r = 97
- -- lad.y.up = 48
- -- lad.y.dow = 80
- -- end
- --nature no ladder
- if(lvl==1) then
- lad.x.l = 0
- lad.x.r = 0
- lad.y.up = 0
- lad.y.dow = 0
- end
- --city no ladder
- if(lvl==2) then
- lad.x.l = 0
- lad.x.r = 0
- lad.y.up = 0
- lad.y.dow = 0
- end
- --front tower no ladder
- if(lvl==3) then
- lad.x.l = 0
- lad.x.r = 0
- lad.y.up = 0
- lad.y.dow = 0
- end
- --nature flowers ladder 1
- if(lvl==4) then
- lad.x.l = 55
- lad.x.r = 57
- lad.y.up = 48
- lad.y.dow = 80
- end
- --nature flowers ladder 2
- if(lvl==4
- and hero.y<=48
- and hero.x>=70) then
- lad.x.l = 71
- lad.x.r = 73
- lad.y.up = 8
- lad.y.dow = 48
- end
- --in tower ladder 1
- if(lvl==3 and looptower==true
- and hero.y<=112
- and hero.x<=52) then
- lad.x.l = 31
- lad.x.r = 33
- lad.y.up = 80
- lad.y.dow = 112
- end
- --in tower ladder 2
- if(lvl==3 and looptower==true
- and hero.y<=80
- and hero.x>=52) then
- lad.x.l = 71
- lad.x.r = 73
- lad.y.up = 48
- lad.y.dow = 80
- end
- --in tower ladder 3
- if(lvl==3 and looptower==true
- and hero.y<=48
- and hero.x>=84) then
- lad.x.l = 87
- lad.x.r = 90
- lad.y.up = 16
- lad.y.dow = 48
- end
- --in tower ladder 4
- if(lvl==3 and looptower==true
- and hero.y<=16
- and hero.x<=50) then
- lad.x.l = 23
- lad.x.r = 26
- lad.y.up = 0
- lad.y.dow = 16
- end
- --acces to down ladder
- if(btn(2)
- and hero.x>=lad.x.l
- and hero.x<=lad.x.r
- and hero.y<=lad.y.dow) then
- hero.y -=1
- ladder = true
- end
- --acces to up ladder
- if(btn(3)
- and hero.x>=lad.x.l
- and hero.x<=lad.x.r
- and hero.y>=lad.y.up) then
- hero.y +=1
- ladder = true
- end
- --blocked if up to ladder
- if(btn(2)
- and hero.y==lad.y.up-1) then
- hero.y +=1
- end
- --blocked if down to ladder
- if(btn(3)
- and hero.y==lad.y.dow+1) then
- hero.y -=1
- end
- --constrain if left
- if(btn(0)
- and hero.x>=lad.x.l
- and hero.x<=lad.x.r
- and hero.y<=lad.y.dow-1
- and hero.y>=lad.y.up+1) then
- hero.x +=1
- end
- --constrain if right
- if(btn(1)
- and hero.x>=lad.x.l
- and hero.x<=lad.x.r
- and hero.y<=lad.y.dow-1
- and hero.y>=lad.y.up+1) then
- hero.x -=1
- end
- --bug if left and right together
- if(btn(0) and btn(1)
- and hero.x>=lad.x.l
- and hero.x<=lad.x.r
- and hero.y<=lad.y.dow-1
- and hero.y>=lad.y.up+1) then
- hero.x +=1
- end
- ladder = false
- end
- -------------------------------
- function _init()
- music(11)
- -- if(looptower==true) music(09)
- -- if(looproyal==true) music(10)
- -- if(bossdead==true) music(8)
- end
- function _update()
- end
- function _draw()
- cls()
- screen()
- getcoin()
- heroxy()
- ladders()
- househero()
- housevillage()
- hud()
- scroll()
- intower()
- royalroom()
- testmove()
- bubble()
- if(bossdead==true) heroend()
- --tests()
- end
Advertisement
Add Comment
Please, Sign In to add comment