From 28a12c24104c9c6f56059b36f8954e3223b86b40 Mon Sep 17 00:00:00 2001 From: Nicholas Hayashi Date: Sat, 20 Feb 2021 21:02:04 -0500 Subject: [PATCH] remove some files, fix lighthouse bug --- NOTES.md | 36 ------------------------------------ README.md | 5 ++++- TODO.md | 24 ------------------------ main.lua | 4 ++-- src/game.lua | 8 ++++---- src/mob.lua | 6 +++--- src/projectile.lua | 8 ++++---- src/tower.lua | 6 +++--- 8 files changed, 20 insertions(+), 77 deletions(-) delete mode 100644 NOTES.md delete mode 100644 TODO.md diff --git a/NOTES.md b/NOTES.md deleted file mode 100644 index 3bb9b44..0000000 --- a/NOTES.md +++ /dev/null @@ -1,36 +0,0 @@ - -SEEED 1835 has bad start - - -@TODO test optimizing pathfinding via breadth first search/djikstra - -MAP RESOURCES -- spawn diamonds or special floating resources that give you bonuses for building on, whether it's score, money, or boosting the effectiveness of the tower you place on top, etc. -- killing certain mobs may cause these resources to spawn on the hex they died on - - -towers: -- redeye - long-range laser tower - only buildable on mountains and upgraded walls - -- lighthouse - light-emitting static tower - only buildable on tiles adjacent to water - mobs strongly prefer to path around lighthouses - -- wall - some fraction of the height of the tallest mountain - makes mob pathing more difficult - - upgrades: - - fortifications - lets you build some qualifying towers on top of this tower - - spikes - mobs take damage when climbing - -- moat - some fraction of the depth of the deepest lake - makes mob pathing more difficult - - upgrades: - - alligators - mobs take damage while swimming - diff --git a/README.md b/README.md index 1275c57..288c4ac 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ ## INTRODUCTION -This is a tower defense game. +This is a tower defense game. It's made using lua, and the amulet game engine made by Ian Maclarty. +If you are interested in a library of code for dealing with hexagonal grids/geometry in your game, the file src/hexyz.lua may be of interest to you, as may be the resources below. + + ## RESOURCES diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 9e9c26d..0000000 --- a/TODO.md +++ /dev/null @@ -1,24 +0,0 @@ - -- fix lighthouse pathing recusrive bug thing -- make more towers -- make/fix radar tower -- do waves -- make mob difficulty scale - - - -towers: -1 - wall -2 - howitzer -3 - -4 - redeye -q - -w - moat -e - -r - radar -a - -s - lighthouse - -d - not a tower, deselects current selection -f - - diff --git a/main.lua b/main.lua index 831d97b..f6ae2eb 100644 --- a/main.lua +++ b/main.lua @@ -206,8 +206,8 @@ function main_scene(do_backdrop, do_logo) end group:append( - am.translate(win.right - 10, win.bottom + 20) - ^ am.text(version, COLORS.WHITE, "right") + am.translate(win.right - 10, win.bottom + 10) + ^ am.text(string.format("v%s, by %s", version, author), COLORS.WHITE, "right", "bottom") ) if do_logo then diff --git a/src/game.lua b/src/game.lua index c30a5c5..14a33a1 100644 --- a/src/game.lua +++ b/src/game.lua @@ -28,7 +28,7 @@ local TRDTS = { local function get_initial_game_state(seed) local STARTING_MONEY = 200 - -- 2014 + local map, world = random_map() return { @@ -41,9 +41,9 @@ local function get_initial_game_state(seed) score = 0, -- current game score money = STARTING_MONEY, -- current money - towers = {}, - mobs = {}, - projectiles = {}, + towers = {}, -- list of tower entities + mobs = {}, -- list of mob entities + projectiles = {}, -- list of projectile entities current_wave = 1, time_until_next_wave = 0, diff --git a/src/mob.lua b/src/mob.lua index 76ddc0a..539d6ff 100644 --- a/src/mob.lua +++ b/src/mob.lua @@ -33,15 +33,15 @@ function get_mob_spec(mob_type) end local function grow_mob_health(mob_type, spec_health, time) - return spec_health * (time / 100 + 1) + return spec_health + (state.current_wave - 1) * 3 end local function grow_mob_speed(mob_type, spec_speed, time) -- @TODO maybe speed shouldn't grow with time at all. -- if it does, a small amount with a horizontal asymptote - return spec_speed --* math.abs(math.log(time / 100)) + return spec_speed end local function grow_mob_bounty(mob_type, spec_bounty, time) - return spec_bounty * (time / 100 + 1) + return spec_bounty + (state.current_wave - 1) * 3 end function mobs_on_hex(hex) diff --git a/src/projectile.lua b/src/projectile.lua index af0e135..0b0338b 100644 --- a/src/projectile.lua +++ b/src/projectile.lua @@ -10,13 +10,13 @@ PROJECTILE_TYPE = { local PROJECTILE_SPECS = { [PROJECTILE_TYPE.SHELL] = { velocity = 13, - damage = 15, + damage = 10, hitbox_radius = 20 }, [PROJECTILE_TYPE.LASER] = { - velocity = 25, - damage = 5, - hitbox_radius = 10 + velocity = 35, + damage = 20, + hitbox_radius = 20 }, } diff --git a/src/tower.lua b/src/tower.lua index 769d5a5..35b1ac8 100644 --- a/src/tower.lua +++ b/src/tower.lua @@ -66,8 +66,8 @@ TOWER_SPECS = { }, [TOWER_TYPE.RADAR] = { name = "Radar", - placement_rules_text = "Place on any non-Water", - short_description = "Provides information about incoming waves.", + placement_rules_text = "n/a", + short_description = "Doesn't do anything right now :(", texture = TEXTURES.TOWER_RADAR, icon_texture = TEXTURES.TOWER_RADAR_ICON, cost = 20, @@ -441,7 +441,7 @@ function update_tower_lighthouse(tower, tower_index) -- is within some angle range...? if the mob is heading directly away from the tower, then -- the lighthouse shouldn't do much - local path, made_it = hex_Astar(state.map, tower.hex, m.hex, grid_neighbours, grid_cost, heuristic) + local path, made_it = hex_Astar(state.map, tower.hex, m.hex, grid_neighbours, grid_cost, grid_heuristic) if made_it then m.path = path