From e96ad330d4069b524bd987cc8631141af17af70e Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 4 Mar 2025 09:58:12 +0800 Subject: fix: enemy misplaced in same type of room encountered before The same type of rooms used to share the same enemy list. When enemies move, their location changed and that changes all location of that enemy object in that room's enemy list. --- data/roomData.lua | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'data/roomData.lua') diff --git a/data/roomData.lua b/data/roomData.lua index e0749e7..d644edf 100644 --- a/data/roomData.lua +++ b/data/roomData.lua @@ -19,13 +19,13 @@ roomData = { width = config.defaultRoomW, height = config.defaultRoomH, enemies = { - Enemy:new("lancer", "topRight"), - Enemy:new("lancer", "topLeft"), - Enemy:new("lancer", "bottomRight"), - Enemy:new("lancer", "bottomLeft"), + {"lancer", "topRight"}, + {"lancer", "topLeft"}, + {"lancer", "bottomRight"}, + {"lancer", "bottomLeft"}, }, obstacles = { - Obstacle:new("pillar", "center") + {"pillar", "center"} }, }, combatRoom2 = { @@ -33,17 +33,17 @@ roomData = { width = config.defaultRoomW, height = config.defaultRoomH, enemies = { - Enemy:new("lancer", "leftCenter"), - Enemy:new("lancer", "rightCenter"), - Enemy:new("fairy", "center"), - Enemy:new("fairy", "center"), - Enemy:new("fairy", "center"), + {"lancer", "leftCenter"}, + {"lancer", "rightCenter"}, + {"fairy", "center"}, + {"fairy", "center"}, + {"fairy", "center"}, }, obstacles = { - Obstacle:new("pillar", "topRight"), - Obstacle:new("pillar", "bottomLeft"), - Obstacle:new("pillar", "topLeft"), - Obstacle:new("pillar", "bottomRight"), + {"pillar", "topRight"}, + {"pillar", "bottomLeft"}, + {"pillar", "topLeft"}, + {"pillar", "bottomRight"}, }, }, combatRoom3 = { @@ -51,13 +51,13 @@ roomData = { width = config.defaultRoomW, height = config.defaultRoomH, enemies = { - Enemy:new("spiger", "leftCenter"), - Enemy:new("spiger", "rightCenter"), - Enemy:new("spiger", "center"), + {"spiger", "leftCenter"}, + {"spiger", "rightCenter"}, + {"spiger", "center"}, }, obstacles = { - Obstacle:new("pillar", "topCenter"), - Obstacle:new("pillar", "bottomCenter"), + {"pillar", "topCenter"}, + {"pillar", "bottomCenter"}, }, }, library = { @@ -65,15 +65,15 @@ roomData = { width = config.defaultRoomW, height = config.defaultRoomH, enemies = { - Enemy:new("librarian", "topCenter"), - Enemy:new("librarian", "bottomCenter"), - Enemy:new("lancer", "center") + {"librarian", "topCenter"}, + {"librarian", "bottomCenter"}, + {"lancer", "center"}, }, obstacles = { - Obstacle:new("pillar", "topRight"), - Obstacle:new("pillar", "bottomLeft"), - Obstacle:new("pillar", "topLeft"), - Obstacle:new("pillar", "bottomRight"), + {"pillar", "topRight"}, + {"pillar", "bottomLeft"}, + {"pillar", "topLeft"}, + {"pillar", "bottomRight"}, }, }, bookstore = { @@ -81,13 +81,13 @@ roomData = { width = config.defaultRoomW, height = config.defaultRoomH, enemies = { - Enemy:new("librarian", "topRight"), - Enemy:new("librarian", "bottomRight"), - Enemy:new("librarian", "topLeft"), - Enemy:new("librarian", "bottomLeft"), + {"librarian", "topRight"}, + {"librarian", "bottomRight"}, + {"librarian", "topLeft"}, + {"librarian", "bottomLeft"}, }, obstacles = { - Obstacle:new("pillar", "center"), + {"pillar", "center"}, }, }, } -- cgit v1.2.3