- 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.
50 lines
1.4 KiB
Lua
50 lines
1.4 KiB
Lua
local actor, super = Class(Actor, "wall")
|
|
|
|
function actor:init()
|
|
super.init(self)
|
|
|
|
-- Display name (optional)
|
|
self.name = "Wall"
|
|
|
|
-- Width and height for this actor, used to determine its center
|
|
self.width = 60
|
|
self.height = 70
|
|
|
|
-- Hitbox for this actor in the overworld (optional, uses width and height by default)
|
|
self.hitbox = { 0, 50, 60, 20 }
|
|
|
|
-- Color for this actor used in outline areas (optional, defaults to red)
|
|
self.color = { 1, 0, 0 }
|
|
|
|
-- Whether this actor flips horizontally (optional, values are "right" or "left", indicating the flip direction)
|
|
self.flip = nil
|
|
|
|
-- Path to this actor's sprites (defaults to "")
|
|
self.path = "npcs/wall"
|
|
-- This actor's default sprite or animation, relative to the path (defaults to "")
|
|
self.default = ""
|
|
|
|
-- Sound to play when this actor speaks (optional)
|
|
self.voice = nil
|
|
-- Path to this actor's portrait for dialogue (optional)
|
|
self.portrait_path = nil
|
|
-- Offset position for this actor's portrait (optional)
|
|
self.portrait_offset = nil
|
|
|
|
-- Whether this actor as a follower will blush when close to the player
|
|
self.can_blush = false
|
|
|
|
-- Table of talk sprites and their talk speeds (default 0.25)
|
|
self.talk_sprites = {
|
|
[""] = 0.2
|
|
}
|
|
|
|
-- Table of sprite animations
|
|
self.animations = {}
|
|
|
|
-- Table of sprite offsets (indexed by sprite name)
|
|
self.offsets = {}
|
|
end
|
|
|
|
return actor
|