Add new maps and tileset for the game world

- 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.
This commit is contained in:
2026-05-01 17:43:39 +02:00
parent ca9edf5f0c
commit 1b6eb9152c
35 changed files with 1747 additions and 4 deletions

View File

@@ -0,0 +1,54 @@
local actor, super = Class(Actor, "dummy")
function actor:init()
super.init(self)
-- Display name (optional)
self.name = "Dummy"
-- Width and height for this actor, used to determine its center
self.width = 27
self.height = 45
-- Hitbox for this actor in the overworld (optional, uses width and height by default)
self.hitbox = { 0, 25, 19, 14 }
-- 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 = "enemies/dummy"
-- This actor's default sprite or animation, relative to the path (defaults to "")
self.default = "idle"
-- 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 = {}
-- Table of sprite animations
self.animations = {
-- Looping animation with 0.25 seconds between each frame
-- (even though there's only 1 idle frame)
["idle"] = { "idle", 0.25, true },
}
-- Table of sprite offsets (indexed by sprite name)
self.offsets = {
-- Since the width and height is the idle sprite size, the offset is 0,0
["idle"] = { 0, 0 },
}
end
return actor

View File

@@ -0,0 +1,47 @@
local actor, super = Class(Actor, "starwalker")
function actor:init()
super.init(self)
-- Display name (optional)
self.name = "Starwalker"
-- Width and height for this actor, used to determine its center
self.width = 37
self.height = 36
-- Hitbox for this actor in the overworld (optional, uses width and height by default)
self.hitbox = { 2, 26, 27, 10 }
-- Color for this actor used in outline areas (optional, defaults to red)
self.color = { 1, 1, 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/starwalker"
-- 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 = {}
-- Table of sprite animations
self.animations = {}
-- Table of sprite offsets (indexed by sprite name)
self.offsets = {}
end
return actor

View File

@@ -0,0 +1,49 @@
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

View File

@@ -0,0 +1,58 @@
-- Instead of Item, create a HealItem, a convenient class for consumable healing items
local item, super = Class(HealItem, "ultimate_candy")
function item:init()
super.init(self)
-- Display name
self.name = "UltimatCandy"
-- Name displayed when used in battle (optional)
self.use_name = "ULTIMATE CANDY"
-- Item type (item, key, weapon, armor)
self.type = "item"
-- Item icon (for equipment)
self.icon = nil
-- Battle description
self.effect = "Best\nhealing"
-- Shop description
self.shop = "Perfection"
-- Menu description
self.description = "Sparkles with perfection.\nMust be shared with everyone. +??HP"
-- Amount healed (HealItem variable)
self.heal_amount = 1
-- Default shop price (sell price is halved)
self.price = 100
-- Whether the item can be sold
self.can_sell = true
-- Consumable target mode (ally, party, enemy, enemies, or none)
self.target = "party"
-- Where this item can be used (world, battle, all, or none)
self.usable_in = "all"
-- Item this item will get turned into when consumed
self.result_item = nil
-- Will this item be instantly consumed in battles?
self.instant = false
-- Equip bonuses (for weapons and armor)
self.bonuses = {}
-- Bonus name and icon (displayed in equip menu)
self.bonus_name = nil
self.bonus_icon = nil
-- Equippable characters (default true for armors, false for weapons)
self.can_equip = {}
-- Character reactions (key = party member id)
self.reactions = {
susie = "Hey! It's hollow inside!",
ralsei = "I like the texture!",
noelle = "That was underwhelming...",
}
end
return item