- Created room1.tmx and room1.lua for the first room in the game, including tiles, collision objects, and NPCs. - Added room2.tmx and room2.lua for the second room, featuring tiles, collision objects, and an enemy. - Introduced a world template to manage map transitions and layout. - Implemented a new tileset (castle.tsx and castle.lua) for the castle theme, including tile properties and image references.
26 lines
794 B
Lua
26 lines
794 B
Lua
local Basic, super = Class(Wave)
|
|
|
|
function Basic:onStart()
|
|
-- Every 0.33 seconds...
|
|
self.timer:every(1 / 3, function()
|
|
-- Our X position is offscreen, to the right
|
|
local x = SCREEN_WIDTH + 20
|
|
-- Get a random Y position between the top and the bottom of the arena
|
|
local y = MathUtils.random(Game.battle.arena.top, Game.battle.arena.bottom)
|
|
|
|
-- Spawn smallbullet going left with speed 8 (see scripts/battle/bullets/smallbullet.lua)
|
|
local bullet = self:spawnBullet("smallbullet", x, y, math.rad(180), 8)
|
|
|
|
-- Dont remove the bullet offscreen, because we spawn it offscreen
|
|
bullet.remove_offscreen = false
|
|
end)
|
|
end
|
|
|
|
function Basic:update()
|
|
-- Code here gets called every frame
|
|
|
|
super.update(self)
|
|
end
|
|
|
|
return Basic
|