diff --git a/main.lua b/main.lua index 9fea7ce..a1589ab 100644 --- a/main.lua +++ b/main.lua @@ -102,16 +102,6 @@ local function game_action(scene) end end - --[[ - if WIN:mouse_pressed"middle" then - WORLD"scale".scale2d = vec2(1) - else - local mwd = vec2(WIN:mouse_wheel_delta().y / 500) - WORLD"scale".scale2d = WORLD"scale".scale2d + mwd - WORLD"scale".scale2d = WORLD"scale".scale2d + mwd - end - ]] - if WIN:key_pressed"escape" then WIN.scene"game".paused = true WIN.scene:append(am.group{ @@ -125,7 +115,6 @@ local function game_action(scene) return true end end) - elseif WIN:key_pressed"f1" then TRDT = (TRDT + 1) % #table.keys(TRDTS) @@ -139,7 +128,6 @@ local function game_action(scene) else select_tower_type((SELECTED_TOWER_TYPE) % num_of_types + 1) end - elseif WIN:key_pressed"1" then select_tower_type(TOWER_TYPE.REDEYE) elseif WIN:key_pressed"2" then select_tower_type(2) elseif WIN:key_pressed"3" then select_tower_type(3) diff --git a/res/Sprite-0001.aseprite b/res/Sprite-0001.aseprite new file mode 100644 index 0000000..557cbdb Binary files /dev/null and b/res/Sprite-0001.aseprite differ diff --git a/res/mountain1.png b/res/mountain1.png deleted file mode 100644 index 78fe79e..0000000 Binary files a/res/mountain1.png and /dev/null differ diff --git a/res/mountain2.png b/res/mountain2.png deleted file mode 100644 index d2503e4..0000000 Binary files a/res/mountain2.png and /dev/null differ diff --git a/res/tower_lighthouse_icon.png b/res/tower_lighthouse_icon.png new file mode 100644 index 0000000..225eccb Binary files /dev/null and b/res/tower_lighthouse_icon.png differ diff --git a/res/tower_moat_icon.png b/res/tower_moat_icon.png new file mode 100644 index 0000000..5f08535 Binary files /dev/null and b/res/tower_moat_icon.png differ diff --git a/res/tower_redeye_icon.png b/res/tower_redeye_icon.png new file mode 100644 index 0000000..f0021cb Binary files /dev/null and b/res/tower_redeye_icon.png differ diff --git a/res/tower_wall1.png b/res/tower_wall1.png deleted file mode 100644 index 8db2b96..0000000 Binary files a/res/tower_wall1.png and /dev/null differ diff --git a/res/tower_wall2.png b/res/tower_wall2.png deleted file mode 100644 index 2132740..0000000 Binary files a/res/tower_wall2.png and /dev/null differ diff --git a/res/tower_wall3.png b/res/tower_wall3.png deleted file mode 100644 index e43af90..0000000 Binary files a/res/tower_wall3.png and /dev/null differ diff --git a/res/tower_wall4.png b/res/tower_wall4.png deleted file mode 100644 index e43af90..0000000 Binary files a/res/tower_wall4.png and /dev/null differ diff --git a/res/tower_wall5.png b/res/tower_wall5.png deleted file mode 100644 index e43af90..0000000 Binary files a/res/tower_wall5.png and /dev/null differ diff --git a/res/tower_wall6.png b/res/tower_wall6.png deleted file mode 100644 index e43af90..0000000 Binary files a/res/tower_wall6.png and /dev/null differ diff --git a/res/tower_wall_icon.png b/res/tower_wall_icon.png new file mode 100644 index 0000000..982d765 Binary files /dev/null and b/res/tower_wall_icon.png differ diff --git a/src/grid.lua b/src/grid.lua index 4fec704..6300095 100644 --- a/src/grid.lua +++ b/src/grid.lua @@ -53,7 +53,7 @@ function evenq_is_interactable(evenq) }) end -local function tile_is_medium_elevation(tile) +function tile_is_medium_elevation(tile) return tile.elevation >= -0.5 and tile.elevation < 0.5 end diff --git a/src/gui.lua b/src/gui.lua index 580ead5..e623e92 100644 --- a/src/gui.lua +++ b/src/gui.lua @@ -109,7 +109,7 @@ function toolbelt() button( size, half_size, - get_tower_texture(tower_type_values[i]), + get_tower_icon_texture(tower_type_values[i]), padding, i, offset, diff --git a/src/tower.lua b/src/tower.lua index f1bf01e..2bc4100 100644 --- a/src/tower.lua +++ b/src/tower.lua @@ -15,6 +15,7 @@ TOWER_SPECS = { placement_rules_text = "Place on mountains or on Walls", short_description = "Long range laser tower", texture = TEXTURES.TOWER_REDEYE, + icon_texture = TEXTURES.TOWER_REDEYE_ICON, base_cost = 25, }, [TOWER_TYPE.LIGHTHOUSE] = { @@ -22,6 +23,7 @@ TOWER_SPECS = { placement_rules_text = "Place next to - but not on - water or moats", short_description = "Attracts and distracts mobs", texture = TEXTURES.TOWER_LIGHTHOUSE, + icon_texture = TEXTURES.TOWER_LIGHTHOUSE_ICON, base_cost = 25 }, [TOWER_TYPE.WALL] = { @@ -29,6 +31,7 @@ TOWER_SPECS = { placement_rules_text = "Place on grass or dirt", short_description = "Restricts movement", texture = TEXTURES.TOWER_WALL, + icon_texture = TEXTURES.TOWER_WALL_ICON, base_cost = 5, }, [TOWER_TYPE.MOAT] = { @@ -36,6 +39,7 @@ TOWER_SPECS = { placement_rules_text = "Place on grass or dirt", short_description = "Restricts movement", texture = TEXTURES.TOWER_MOAT, + icon_texture = TEXTURES.TOWER_MOAT_ICON, base_cost = 5, } } @@ -52,6 +56,9 @@ end function get_tower_texture(tower_type) return TOWER_SPECS[tower_type] and TOWER_SPECS[tower_type].texture end +function get_tower_icon_texture(tower_type) + return TOWER_SPECS[tower_type] and TOWER_SPECS[tower_type].icon_texture +end function get_tower_base_cost(tower_type) return TOWER_SPECS[tower_type] and TOWER_SPECS[tower_type].base_cost end @@ -194,6 +201,16 @@ function update_tower_lighthouse(tower, tower_index) if made_it then m.path = path + + local area = spiral_map(tower.hex, tower.range) + for _,h in pairs(area) do + local node = HEX_MAP[h.x][h.y].node"circle" + local initial_color = node.color + node:late_action(am.series{ + am.tween(node, 0.1, { color = COLORS.SUNRAY }), + am.tween(node, 0.1, { color = initial_color }) + }) + end end end end diff --git a/texture.lua b/texture.lua index 7cfc4d1..a437939 100644 --- a/texture.lua +++ b/texture.lua @@ -11,8 +11,10 @@ TEXTURES = { TOWER_WALL = am.texture2d("res/tower_wall.png"), TOWER_MOAT = am.texture2d("res/tower_moat.png"), - MOUNTAIN1 = am.texture2d("res/mountain1.png"), - MOUNTAIN2 = am.texture2d("res/mountain2.png"), + TOWER_REDEYE_ICON = am.texture2d("res/tower_redeye_icon.png"), + TOWER_LIGHTHOUSE_ICON = am.texture2d("res/tower_lighthouse_icon.png"), + TOWER_WALL_ICON = am.texture2d("res/tower_wall_icon.png"), + TOWER_MOAT_ICON = am.texture2d("res/tower_moat_icon.png"), MOB_BEEPER = am.texture2d("res/mob_beeper.png"), }