Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spawntimer = 15
- counter = 0
- timer = -1
- SetGlobal("BootY",241)
- bullets = {}
- oblib = require "objectdefs"
- blue = require "Libraries/bluesoul"
- blasters = require ("Libraries/gaster_blasters")
- blue.Initialize()
- --This bullet is for having the player heart blink properly
- waveStartTime = Time.time
- ourTime = Time.time
- timeMult = 1
- NORMAL = 0
- THIN = 1
- LARGE = 2
- ORANGE = 0
- BLUE = 1
- platforms = {}
- isBlue = false
- Encounter.SetVar("wavetimer", 19.5)
- Player.MoveTo(0,0+25,true)
- arenasize = {155, 130}
- function Update()
- blasters.Update()
- spawntimer = spawntimer + 1
- blue.HandleMovement()
- ourTime = ourTime + (Time.dt * timeMult)
- if spawntimer == 60 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 120 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 180 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 240 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 300 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 360 then
- blasters.New(1000,Player.absy,500,Player.absy,-90,90)
- elseif spawntimer == 420 and isBlue == false then
- blue.Update()
- elseif spawntimer == 440 then
- sidebones = CreateProjectile("floorbones_0",0, -Arena.width/2+20)
- sidebones.SetVar("display",true)
- sidebones.SetVar("nobreak",true)
- Audio.PlaySound("encounter")
- elseif spawntimer == 482 then
- sidebones.sprite.Set("floorbones_1")
- elseif spawntimer == 482 then
- sidebones.sprite.Set("floorbones_2")
- elseif spawntimer == 484 then
- sidebones.sprite.Set("floorbones_3")
- Audio.PlaySound("pierce")
- sidebones.SetVar("display",false)
- elseif spawntimer == 486 then
- sidebones.sprite.Set("floorbones_4")
- elseif spawntimer == 494 then
- sidebones.sprite.Set("floorbones_3")
- elseif spawntimer == 496 then
- sidebones.sprite.Set("floorbones_2")
- sidebones.SetVar("display",true)
- elseif spawntimer == 498 then
- sidebones.sprite.Set("floorbones_1")
- elseif spawntimer == 500 then
- sidebones.Remove()
- end
- for k,v in pairs(platforms) do
- if v.isactive then
- v.Move(v.GetVar("speed"), 0)
- end
- end
- for i=1,#bullets do
- local bullet = bullets[i]
- local dir = bullet.GetVar("dir")
- if bullet.x != -400 and bullet.y != -400 then
- if dir == "right" then
- bullet.Move(bullet.GetVar('speed'),0)
- if bullet.x > Arena.width/2-bullet.GetVar('speed') and not bullet.GetVar("nofade") then
- bullet.MoveTo(-400,-400)
- end
- elseif dir == "left" then
- bullet.Move(-bullet.GetVar('speed'),0)
- if bullet.x < -Arena.width/2+bullet.GetVar('speed') and not bullet.GetVar("nofade") then
- bullet.MoveTo(-400,-400)
- end
- elseif dir == "up" then
- bullet.Move(0,bullet.GetVar('speed'))
- if bullet.y > Arena.height/2-bullet.GetVar('speed') and not bullet.GetVar("nofade") then
- bullet.MoveTo(-400,-400)
- end
- elseif dir == "down" then
- bullet.Move(0,-bullet.GetVar('speed'))
- if bullet.y < -Arena.height/2+bullet.GetVar('speed') and not bullet.GetVar("nofade") then
- bullet.MoveTo(-400,-400)
- end
- end
- end
- end
- blue.platforms = platforms
- end
- function OnHit(bullet)
- --"Tile" bullets shouldn't collide with the player. Board tiles, fading lasers, whatever else
- if not bullet.GetVar("display") then
- if(bullet.GetVar('tile') ~= 1) then
- if (bullet.GetVar('colour') == BLUE) then
- if (Player.isMoving) then
- Player.Hurt(bullet.GetVar('damage'))
- SetGlobal("hit1",true)
- Encounter.Call("Karma_Inc", 1)
- end
- elseif (bullet.GetVar('colour') == ORANGE) then
- if (not Player.isMoving) then
- Player.Hurt(bullet.GetVar('damage'))
- SetGlobal("hit1",true)
- Encounter.Call("Karma_Inc", 1)
- end
- else
- Player.Hurt(1,0)
- SetGlobal("hit1",true)
- Encounter.Call("Karma_Inc", 1)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement