Nicholas Hayashi
4 years ago
16 changed files with 274 additions and 145 deletions
-
BINres/077-8332_001.jpg
-
BINres/arrow.png
-
BINres/marquis.png
-
BINres/tower1.png
-
BINres/tower2.png
-
5src/color.lua
-
2src/extra.lua
-
47src/grid.lua
-
6src/gui.lua
-
114src/hexyz.lua
-
0src/log.txt
-
90src/main.lua
-
86src/mob.lua
-
20src/sound.lua
-
11src/texture.lua
-
38src/tower.lua
After Width: 2000 | Height: 2000 | Size: 716 KiB |
After Width: 46 | Height: 58 | Size: 518 B |
After Width: 306 | Height: 40 | Size: 452 B |
After Width: 137 | Height: 137 | Size: 2.5 KiB |
After Width: 32 | Height: 32 | Size: 487 B |
@ -1,14 +1,14 @@ |
|||||
|
|
||||
SOUNDS = { |
SOUNDS = { |
||||
EXPLOSION1 = 49179102, -- this slowed sounds metal as fuck |
|
||||
EXPLOSION2 = 19725402, |
|
||||
LASER1 = 79859301, |
|
||||
PUSH1 = 30455908, |
|
||||
BIRD1 = 50838307, |
|
||||
RANDOM1 = 85363309, |
|
||||
RANDOM2 = 15482409, |
|
||||
RANDOM3 = 58658009, |
|
||||
RANDOM4 = 89884209, |
|
||||
RANDOM5 = 36680709 |
|
||||
|
EXPLOSION1 = 49179102, -- this slowed sounds metal as fuck |
||||
|
EXPLOSION2 = 19725402, |
||||
|
LASER1 = 79859301, |
||||
|
PUSH1 = 30455908, |
||||
|
BIRD1 = 50838307, |
||||
|
RANDOM1 = 85363309, |
||||
|
RANDOM2 = 15482409, |
||||
|
RANDOM3 = 58658009, |
||||
|
RANDOM4 = 89884209, |
||||
|
RANDOM5 = 36680709 |
||||
} |
} |
||||
|
|
@ -1,15 +1,43 @@ |
|||||
|
|
||||
TOWERS = {} |
|
||||
|
local TOWERS = {} |
||||
|
--[[ |
||||
|
tower structure: |
||||
|
{ |
||||
|
TOB - float -- time stamp in seconds of when the tower was spawned |
||||
|
hex - vec2 -- hexagon the tower is on |
||||
|
position - vec2 -- true pixel coordinates |
||||
|
node - node -- the root graph node for this tower |
||||
|
update - function -- function that gets called every frame with itself as an argument |
||||
|
} |
||||
|
]] |
||||
|
|
||||
|
function is_buildable(hex, tile, tower) |
||||
|
local blocked = mob_on_hex(hex) |
||||
|
return not blocked and is_passable(tile) |
||||
|
end |
||||
|
|
||||
function is_buildable(tile, tower) |
|
||||
|
function make_tower(hex) |
||||
|
local tower = {} |
||||
|
|
||||
end |
|
||||
|
tower.TOB = TIME |
||||
|
tower.hex = hex |
||||
|
tower.position = hex_to_pixel(tower.hex) |
||||
|
tower.node = am.translate(tower.position) |
||||
|
^ pack_texture_into_sprite(TEX_TOWER1, 55, 55) |
||||
|
|
||||
|
tower.update = function(_tower) end |
||||
|
|
||||
function make_tower() |
|
||||
|
-- make this cell impassable |
||||
|
--HEX_MAP.get(hex.x, hex.y).elevation = 2 |
||||
|
|
||||
|
WIN.scene"world":append(tower.node) |
||||
|
|
||||
|
return tower |
||||
end |
end |
||||
|
|
||||
function do_tower_updates() |
function do_tower_updates() |
||||
|
|
||||
|
for i,tower in pairs(TOWERS) do |
||||
|
tower.update(tower, i) |
||||
|
end |
||||
end |
end |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue