woody initial et horizontalhats variante
This commit is contained in:
@@ -23,9 +23,8 @@ function Woody:init()
|
|||||||
|
|
||||||
-- List of possible wave ids, randomly picked each turn
|
-- List of possible wave ids, randomly picked each turn
|
||||||
self.waves = {
|
self.waves = {
|
||||||
"basic",
|
"horizontalhats",
|
||||||
"aiming",
|
"stackinghats"
|
||||||
"movingarena"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Dialogue randomly displayed in the enemy's speech bubble
|
-- Dialogue randomly displayed in the enemy's speech bubble
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
local HorizontalHats, super = Class(Wave)
|
local HorizontalHats, super = Class(Wave)
|
||||||
|
|
||||||
|
|
||||||
|
wave_number = 1
|
||||||
function HorizontalHats:init()
|
function HorizontalHats:init()
|
||||||
super.init(self)
|
super.init(self)
|
||||||
|
|
||||||
-- The duration of our wave, in seconds. (Defaults to `5`)
|
-- The duration of our wave, in seconds. (Defaults to `5`)
|
||||||
self.time = 7
|
self.time = 4.5
|
||||||
self.count = 0
|
self.count = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ function HorizontalHats:onStart()
|
|||||||
-- code here gets called at the start of the wave
|
-- code here gets called at the start of the wave
|
||||||
-- create a bullet in the center of the screen
|
-- create a bullet in the center of the screen
|
||||||
arena = Game.battle.arena
|
arena = Game.battle.arena
|
||||||
local x_positions = {arena.x - SCREEN_WIDTH/3.3, arena.x + SCREEN_WIDTH/3.3, arena.x - SCREEN_WIDTH/3.3}
|
local x_positions = {arena.x - SCREEN_WIDTH/4, arena.x + SCREEN_WIDTH/4, arena.x - SCREEN_WIDTH/4}
|
||||||
local y_positions = {arena.y*0.73, arena.y*1, arena.y*1.25}
|
local y_positions = {arena.y*0.73, arena.y*1, arena.y*1.25}
|
||||||
self.collider1 = LineCollider(self, x_positions[2] + 10, y_positions[1], x_positions[2] + 10, y_positions[3])
|
self.collider1 = LineCollider(self, x_positions[2] + 10, y_positions[1], x_positions[2] + 10, y_positions[3])
|
||||||
self.collider2 = LineCollider(self, x_positions[1] - 10, y_positions[1], x_positions[1] - 10, y_positions[3])
|
self.collider2 = LineCollider(self, x_positions[1] - 10, y_positions[1], x_positions[1] - 10, y_positions[3])
|
||||||
@@ -22,7 +22,7 @@ function HorizontalHats:onStart()
|
|||||||
for i = 1, 3, 1 do
|
for i = 1, 3, 1 do
|
||||||
local x = x_positions[i]
|
local x = x_positions[i]
|
||||||
local y = y_positions[i]
|
local y = y_positions[i]
|
||||||
self.bullets[i] = self:spawnBullet("hatbulllet", x, y, 0, 6.7)
|
self.bullets[i] = self:spawnBullet("hatbulllet", x, y, 0, 0)
|
||||||
self.bullets[i]:setScale(2.2)
|
self.bullets[i]:setScale(2.2)
|
||||||
if (i == 1 or i == 3) then
|
if (i == 1 or i == 3) then
|
||||||
self.bullets[i].physics.direction = math.rad(0)
|
self.bullets[i].physics.direction = math.rad(0)
|
||||||
@@ -30,6 +30,17 @@ function HorizontalHats:onStart()
|
|||||||
self.bullets[i].physics.direction = math.rad(180)
|
self.bullets[i].physics.direction = math.rad(180)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
self.timer:script(function (wait)
|
||||||
|
for i = 1, 3, 1 do
|
||||||
|
if wave_number%2 == 0 then
|
||||||
|
self.bullets[i].physics.speed = 6.7
|
||||||
|
wait(1/3)
|
||||||
|
else
|
||||||
|
self.bullets[i].physics.speed = 6.7
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
wave_number = wave_number + 1
|
||||||
super.onStart(self)
|
super.onStart(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local StackingHats, super = Class(Wave)
|
|||||||
function StackingHats:init()
|
function StackingHats:init()
|
||||||
super.init(self)
|
super.init(self)
|
||||||
-- The duration of our wave, in seconds. (Defaults to `5`)
|
-- The duration of our wave, in seconds. (Defaults to `5`)
|
||||||
self.time = 8
|
self.time = 8.4
|
||||||
self.count = 1
|
self.count = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user