-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRageZombieSpawner.lua
More file actions
25 lines (20 loc) · 886 Bytes
/
Copy pathRageZombieSpawner.lua
File metadata and controls
25 lines (20 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local SpawnerBuilding = require("SpawnerBuilding")
local RageZombie = require("RageZombie")
local RageZombieSpawner = {}
local RageZombieSpawner = setmetatable({}, { __index = SpawnerBuilding })
RageZombieSpawner.__index = RageZombieSpawner
function RageZombieSpawner.new(x,y,width, height, spawnrate)
local self = setmetatable(SpawnerBuilding.new(x, y,width, height, spawnrate), RageZombieSpawner)
self.type = "zombie"
self.color = {1,0,0}
self.zombies = zombies
self.spawnrate = spawnrate or 5
self.buildingFrontX = self.x + self.width + 15
self.buildingFrontY = self.y + self.height/2 -- put it 15 pixels above the center of the building
self.type = "RageZombieSpawner"
return self
end
function RageZombieSpawner:spawnNPC()
table.insert(self.zombies, RageZombie.new(self.buildingFrontX, self.buildingFrontY))
end
return RageZombieSpawner