Advertisement
Guest User

Chorpe

a guest
Nov 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.41 KB | None | 0 0
  1. local paralX = API.load("paralX")
  2. local particles = API.load("particles")
  3.  
  4. -- Enemy absorbing
  5. EnemVar = 0
  6.  
  7. -- Load the bgs
  8. local pic1i = Graphics.loadImage ("pic1.png")
  9. local pic2i = Graphics.loadImage ("pic2.png")
  10. local pic3i = Graphics.loadImage ("pic3.png")
  11. local pic4i = Graphics.loadImage ("pic4.png")
  12. local pic5i = Graphics.loadImage ("pic5.png")
  13. -- Load images
  14. local hud1 = Graphics.loadImage ("hud1.png")
  15. local hud2 = Graphics.loadImage ("hud2.png")
  16. local hud3 = Graphics.loadImage ("hud3.png")
  17. local hud4 = Graphics.loadImage ("hud4.png")
  18.  
  19. function onStart ()
  20.   Graphics.activateHud(false)
  21.   Defines.jumpheight_bounce = 0.7;
  22. -- Player Stuff
  23.   player.powerup = 2
  24.   player.character = 1
  25.         pic1       = paralX.create ({image=pic1i,                   priority=-0.5,     repeatX=true,                repeatY=false,   parallaxX=1,    parallaxY=1,   sections={1}})
  26.         pic2       = paralX.create ({image=pic2i,                   priority=-0.5,     repeatX=true,                repeatY=false,   parallaxX=1,    parallaxY=1,   sections={2}})
  27.         pic3       = paralX.create ({image=pic3i,                   priority=-0.5,     repeatX=true,                repeatY=false,   parallaxX=1,    parallaxY=1,   sections={3}})
  28.         pic4       = paralX.create ({image=pic4i,                   priority=-0.5,     repeatX=true,                repeatY=false,   parallaxX=1,    parallaxY=1,   sections={4}})
  29.         pic5       = paralX.create ({image=pic5i,                   priority=-0.5,     repeatX=true,                repeatY=false,   parallaxX=1,    parallaxY=1,   sections={5}})
  30. end
  31. function onNPCKill(_, killedNPC, _)
  32.      if killedNPC.id == 25 then
  33.           Audio.playSFX("ninjl.wav");
  34.           Defines.earthquake = 5;
  35.           Defines.jumpheight_bounce = 30;
  36.           EnemVar = 1          
  37.      end
  38.      if killedNPC.id == 126 then
  39.           Audio.playSFX("sound2.wav");
  40.           Defines.earthquake = 3;
  41.           Defines.jumpheight_bounce = 0.7;
  42.           EnemVar = 2
  43.      end
  44.      if killedNPC.id == 29 then
  45.           Audio.playSFX("ninjl.wav");
  46.           Defines.earthquake = 10;
  47.           Defines.jumpheight_bounce = 20;
  48.           player.powerup = 6        
  49.           EnemVar = 3    
  50.      end
  51. end
  52.  
  53. function onTick ()
  54. Graphics.draw{type = RTYPE_IMAGE, x = 0, y = 0, priority=4, image=hud1}
  55. -- Enemy Absorb. Hud
  56.        if EnemVar == 1 then
  57.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 4, priority=5, text = "Purple Ninji Power"}
  58.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 20, priority=5, text = "Super Bounce Ability"}
  59.           Graphics.draw{type = RTYPE_IMAGE, x = 0, y = 0, priority=5, image=hud2}
  60.        end
  61.        if EnemVar == 2 then
  62.           Graphics.draw{type = RTYPE_IMAGE, x = 0, y = 0, priority=5, image=hud3}
  63.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 4, priority=5, text = "Green Ninji Power"}
  64.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 20, priority=5, text = "Low Bounce Ability"}
  65.        end
  66.        if EnemVar == 3 then
  67.           Graphics.draw{type = RTYPE_IMAGE, x = 0, y = 0, priority=5, image=hud4}
  68.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 4, priority=5, text = "Hammer Bro Power"}
  69.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 20, priority=5, text = "Throw Hammers Ability"}
  70.        end
  71.        if EnemVar == 0 then
  72.           Graphics.draw{type = RTYPE_TEXT, x = 68, y = 4, priority=5, text = "No Power!"}
  73.        end
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement