Browse Source

update howitzer icon

master
Nicholas Hayashi 3 years ago
parent
commit
3b1943bcd3
  1. BIN
      res/tower_howitzer_icon.png
  2. 9
      src/game.lua
  3. 6
      src/grid.lua
  4. 6
      src/mob.lua
  5. 6
      src/tower.lua
  6. 2
      texture.lua

BIN
res/tower_howitzer_icon.png

After

Width: 600  |  Height: 450  |  Size: 85 KiB

9
src/game.lua

@ -17,7 +17,8 @@ local TRDTS = {
local function get_initial_game_state(seed)
local STARTING_MONEY = 50
local map, world = random_map(seed)
local map = random_map(seed)
local world = make_hex_grid_scene(map)
return {
map = map, -- map of hex coords map[x][y] to a 'tile'
@ -104,7 +105,6 @@ local function game_pause()
end
local function game_deserialize(json_string)
-- @TODO decode from some compressed format or whatever
local new_state = am.parse_json(json_string)
if new_state.version ~= version then
@ -112,7 +112,8 @@ local function game_deserialize(json_string)
return nil
end
new_state.map, new_state.world = random_map(new_state.seed)
new_state.map = random_map(new_state.seed)
new_state.world = make_hex_grid_scene(new_state.map)
new_state.seed = nil
for i,t in pairs(new_state.towers) do
@ -190,7 +191,6 @@ local function game_serialize()
end
end
-- @TODO b64 encode or otherwise scramble/compress
return am.to_json(serialized)
end
@ -640,7 +640,6 @@ function update_money(diff) state.money = state.money + diff end
function game_end()
state = {}
game = false
-- @TODO anything
end
function game_save()

6
src/grid.lua

@ -172,8 +172,8 @@ function map_elevation_color(elevation)
else
-- @TODO probably fix... this only happens when loading a save, and the tile has an elevation that's
-- higher that anything here
return vec4(0.1)
-- higher that anything here. it isn't really of any consequence though
return vec4(0)
end
end
@ -258,6 +258,6 @@ function random_map(seed)
end
end
return map, make_hex_grid_scene(map)
return map
end

6
src/mob.lua

@ -7,7 +7,7 @@ MOB_TYPE = {
MAX_MOB_SIZE = hex_height(HEX_SIZE, HEX_ORIENTATION.FLAT) / 2
MOB_SIZE = MAX_MOB_SIZE
MOB_SPECS = {
local MOB_SPECS = {
[MOB_TYPE.BEEPER] = {
health = 30,
speed = 8,
@ -33,9 +33,7 @@ local function grow_mob_health(mob_type, spec_health, time)
return spec_health + math.pow(state.current_wave - 1, 2)
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
return spec_speed + math.log(state.current_wave + 1)
end
local function grow_mob_bounty(mob_type, spec_bounty, time)
return spec_bounty + math.pow(state.current_wave - 1, 2)

6
src/tower.lua

@ -12,7 +12,7 @@ TOWER_TYPE = {
LIGHTHOUSE = 6
}
TOWER_SPECS = {
local TOWER_SPECS = {
[TOWER_TYPE.WALL] = {
name = "Wall",
placement_rules_text = "Place on Ground",
@ -31,7 +31,7 @@ TOWER_SPECS = {
short_description = "Fires area of effect artillery.",
texture = TEXTURES.TOWER_HOWITZER,
icon_texture = TEXTURES.TOWER_HOWITZER_ICON,
cost = 20,
cost = 30,
range = 6,
fire_rate = 4,
size = 0,
@ -79,7 +79,7 @@ TOWER_SPECS = {
short_description = "Attracts nearby mobs; temporarily redirects their path",
texture = TEXTURES.TOWER_LIGHTHOUSE,
icon_texture = TEXTURES.TOWER_LIGHTHOUSE_ICON,
cost = 20,
cost = 70,
range = 7,
fire_rate = 1,
size = 0,

2
texture.lua

@ -65,7 +65,7 @@ function pack_texture_into_sprite(texture, width, height, color)
y1 = 0, y2 = height, height = height
}
if color then sprite.color end
if color then sprite.color = color end
return sprite
end

Loading…
Cancel
Save