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.

48 lines
1.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. local function load_texture(filepath)
  2. local status, texture = pcall(am.texture2d, filepath)
  3. if status then
  4. return texture
  5. else
  6. return am.texture2d("res/bagel.jpg")
  7. end
  8. end
  9. TEXTURES = {
  10. LOGO = load_texture("res/logo.png"),
  11. GEM1 = load_texture("res/gem1.png"),
  12. BUTTON1 = load_texture("res/button1.png"),
  13. WIDER_BUTTON1 = load_texture("res/wider_button1.png"),
  14. TAB_ICON = load_texture("res/tab_icon.png"),
  15. -- tower stuff
  16. TOWER_WALL = load_texture("res/tower_wall.png"),
  17. TOWER_WALL_ICON = load_texture("res/tower_wall_icon.png"),
  18. TOWER_HOWITZER = load_texture("res/tower_howitzer.png"),
  19. CANNON1 = load_texture("res/cannon1.png"),
  20. TOWER_HOWITZER_ICON = load_texture("res/tower_howitzer_icon.png"),
  21. TOWER_REDEYE = load_texture("res/tower_redeye.png"),
  22. TOWER_REDEYE_ICON = load_texture("res/tower_redeye_icon.png"),
  23. TOWER_MOAT = load_texture("res/tower_moat.png"),
  24. TOWER_MOAT_ICON = load_texture("res/tower_moat_icon.png"),
  25. TOWER_RADAR = load_texture("res/tower_radar.png"),
  26. TOWER_RADAR_ICON = load_texture("res/tower_radar_icon.png"),
  27. TOWER_LIGHTHOUSE = load_texture("res/tower_lighthouse.png"),
  28. TOWER_LIGHTHOUSE_ICON = load_texture("res/tower_lighthouse_icon.png"),
  29. -- mob stuff
  30. MOB_BEEPER = load_texture("res/mob_beeper.png"),
  31. MOB_SPOODER = load_texture("res/mob_spooder.png"),
  32. }
  33. function pack_texture_into_sprite(texture, width, height)
  34. return am.sprite{
  35. texture = texture,
  36. s1 = 0, s2 = 1, t1 = 0, t2 = 1,
  37. x1 = 0, x2 = width, width = width,
  38. y1 = 0, y2 = height, height = height
  39. }
  40. end