Browse Source

add builds

master
Nicholas Hayashi 4 years ago
parent
commit
cdce7a85bc
  1. BIN
      .DS_Store
  2. 2
      .gitignore
  3. 1
      build.sh
  4. 0
      color.lua
  5. 13
      conf.lua
  6. 18
      main.lua
  7. 2
      sound.lua
  8. 3
      src/grid.lua
  9. 4
      src/mob.lua
  10. 24
      src/texture.lua
  11. 24
      texture.lua

BIN
.DS_Store

2
.gitignore

@ -0,0 +1,2 @@
bin/
log.txt

1
build.sh

@ -0,0 +1 @@
amulet export -r -d bin/ -mac -a .

0
src/color.lua → color.lua

13
conf.lua

@ -0,0 +1,13 @@
title = "hexyz"
author = "nick hayashi"
shortname = "hexyz"
version = "1.0.0"
support_email = "hayashi.nicholas@gmail.com"
copyright_message = "Copyright © 2021 Nick Hayashi"
dev_region = "en"
supported_languages = "en"
luavm = "luajit"

18
src/main.lua → main.lua

@ -6,11 +6,18 @@ math.random()
math.random()
require "color"
require "entity"
require "grid"
require "mob"
require "projectile"
require "tower"
require "sound"
require "texture"
require "src/hexyz"
require "src/entity"
require "src/extra"
require "src/grid"
require "src/gui"
require "src/mob"
require "src/projectile"
require "src/tower"
-- Globals
WIN = am.window{
@ -72,6 +79,7 @@ local function game_action(scene)
pause()
elseif WIN:key_pressed"f2" then
delete_all_entities()
WIN.scene = game_scene()
elseif WIN:key_pressed"f3" then

2
src/sound.lua → sound.lua

@ -16,7 +16,7 @@ SOUNDS = {
RANDOM5 = 36680709,
-- audio buffers
TRACK1 = am.track(am.load_audio("../res/track1.ogg"), true, 1, 0.1)
TRACK1 = am.track(am.load_audio("./res/track1.ogg"), true, 1, 0.1)
}
-- play a sound with variable pitch

3
src/grid.lua

@ -1,8 +1,5 @@
require "gui"
require "hexyz"
HEX_SIZE = 20
-- with 1920x1080, this is the minimal dimensions to cover the screen (65x33)

4
src/mob.lua

@ -1,9 +1,5 @@
require "extra"
require "sound"
-- @NOTE returns i,v in the table
function mob_on_hex(hex)
return table.find(ENTITIES, function(entity)

24
src/texture.lua

@ -1,24 +0,0 @@
function load_textures()
TEX_MARQUIS = am.texture2d("../res/marquis.png")
TEX_ARROW = am.texture2d("../res/arrow.png")
TEX_WALL_CLOSED = am.texture2d("../res/wall_closed.png")
TEX_TOWER1 = am.texture2d("../res/tower1.png")
TEX_TOWER2 = am.texture2d("../res/tower2.png")
TEX_MOB1_1 = am.texture2d("../res/mob1_1.png")
TEX_MOB2_1 = am.texture2d("../res/mob2_1.png")
end
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

24
texture.lua

@ -0,0 +1,24 @@
function load_textures()
TEX_MARQUIS = am.texture2d("./res/marquis.png")
TEX_ARROW = am.texture2d("./res/arrow.png")
TEX_WALL_CLOSED = am.texture2d("./res/wall_closed.png")
TEX_TOWER1 = am.texture2d("./res/tower1.png")
TEX_TOWER2 = am.texture2d("./res/tower2.png")
TEX_MOB1_1 = am.texture2d("./res/mob1_1.png")
TEX_MOB2_1 = am.texture2d("./res/mob2_1.png")
end
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
Loading…
Cancel
Save