diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-14 16:36:59 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-14 16:36:59 +0800 |
| commit | 625e8271fb4238810e58525e2c5fbc2f5b0a96dc (patch) | |
| tree | 3c9cae152b6e3d06fdbdb4c815ab85f204a84285 /config.lua | |
| parent | 3dab7a77c5799682bdf0517771a45ffd7a4f33ad (diff) | |
refactor: clearer structure of config global
Diffstat (limited to 'config.lua')
| -rw-r--r-- | config.lua | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -3,7 +3,6 @@ config = { debug = false, lang = "zh", - playerShieldTime = 3, lootSize = 5, heartSize = 15, @@ -19,16 +18,20 @@ config = { defaultRoomW = 0.85, defaultRoomH = 0.8, - bulletSpeed = 300, - bulletSize = 15, - summonMargin = 30, - defaultPlayerSpeed = 100, - playerShootCooldown = 0.2, + bullet = { + speed = 300, + size = 15, + }, player = { size = 20, + speed = 100, + shieldTime = 3, + shoot = { + cooldown = 0.2, + }, punch = { radius = 15, angle = 120, @@ -47,8 +50,10 @@ config = { mobSummonDelay = 1, }, - initialMapSize = 7, - extendedMapSize = 5, + map = { + initialRoomCount = 7, + extendedRoomCount = 5, + }, defaultMusic = "briskFight" } @@ -81,7 +86,7 @@ function initGame() G.player = Player:new() - G.allRooms = mapGen.generate(config.initialMapSize, true) + G.allRooms = mapGen.generate(config.map.initialRoomCount, true) G.currentRoom = G.allRooms[1] G.currentRoom:init() |
