hexyz is tower defense game, and a lua library for dealing with hexagonal grids
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.6 KiB

local function load_texture(filepath)
local status, texture = pcall(am.texture2d, filepath)
if status then
return texture
else
return am.texture2d("res/bagel.jpg")
end
end
TEXTURES = {
LOGO = load_texture("res/logo.png"),
BUTTON1 = load_texture("res/button1.png"),
WIDER_BUTTON1 = load_texture("res/wider_button1.png"),
TAB_ICON = load_texture("res/tab_icon.png"),
-- tower stuff
TOWER_WALL = load_texture("res/tower_wall.png"),
TOWER_WALL_ICON = load_texture("res/tower_wall_icon.png"),
TOWER_HOWITZER = load_texture("res/tower_howitzer.png"),
TOWER_HOWITZER_ICON = load_texture("res/tower_howitzer_icon.png"),
TOWER_REDEYE = load_texture("res/tower_redeye.png"),
TOWER_REDEYE_ICON = load_texture("res/tower_redeye_icon.png"),
TOWER_MOAT = load_texture("res/tower_moat.png"),
TOWER_MOAT_ICON = load_texture("res/tower_moat_icon.png"),
TOWER_RADAR = load_texture("res/tower_radar.png"),
TOWER_RADAR_ICON = load_texture("res/tower_radar_icon.png"),
TOWER_LIGHTHOUSE = load_texture("res/tower_lighthouse.png"),
TOWER_LIGHTHOUSE_ICON = load_texture("res/tower_lighthouse_icon.png"),
-- mob stuff
MOB_BEEPER = load_texture("res/mob_beeper.png"),
}
function pack_texture_into_sprite(texture, width, height)
return am.sprite{
texture = texture,
s1 = 0, s2 = 1, t1 = 0, t2 = 1,
x1 = 0, x2 = width, width = width,
y1 = 0, y2 = height, height = height
}
end