Nicholas Hayashi
4 years ago
12 changed files with 191 additions and 95 deletions
-
BINres/mob1_1.png
-
26src/color.lua
-
17src/colors.lua
-
4src/grid.lua
-
58src/hexyz.lua
-
37src/main.lua
-
9src/math.lua
-
92src/mob.lua
-
14src/sound.lua
-
14src/table.lua
-
5src/texture.lua
-
10src/util.lua
After Width: 638 | Height: 639 | Size: 6.1 KiB |
@ -0,0 +1,26 @@ |
|||
|
|||
|
|||
COLORS = { |
|||
TRANSPARENT = vec4(0.4), |
|||
|
|||
-- tones |
|||
WHITE = vec4(0.8, 0.8, 0.7, 1), |
|||
BLACK = vec4(0, 0, 0, 1), |
|||
TRUEBLACK = vec4(0, 0, 0, 1), |
|||
|
|||
-- hues |
|||
BLUE_STONE = vec4(0.12, 0.3, 0.3, 1), |
|||
MYRTLE = vec4(0.10, 0.25, 0.10, 1), |
|||
BROWN_POD = vec4(0.25, 0.20, 0.10, 1), |
|||
BOTTLE_GREEN = vec4(0.15, 0.30, 0.20, 1), |
|||
MAGENTA = vec4(1, 0, 1, 1), |
|||
TEAL = vec4(16/255, 126/255, 124/244, 1), |
|||
YALE_BLUE = vec4(4/255, 75/255, 127/255, 1), |
|||
OLIVE = vec4(111/255, 124/254, 18/255, 1), |
|||
LIGHT_CYAN = vec4(224/255, 251/255, 252/255, 1), |
|||
PALE_SILVER = vec4(193/255, 178/255, 171/255, 1), |
|||
CLARET = vec4(139/255, 30/255, 63/255, 1), |
|||
BISTRO = vec4(73/255, 44/255, 29/255, 1), |
|||
DEEP_SPACE_SPARKLE = vec4(61/255, 90/255, 108/255, 1) |
|||
} |
|||
|
@ -1,17 +0,0 @@ |
|||
|
|||
COLORS = { |
|||
TRANSPARENT = vec4(0.4), |
|||
|
|||
-- tones |
|||
WHITE = vec4(0.8, 0.8, 0.7, 1), |
|||
BLACK = vec4(0, 0, 0, 1), |
|||
TRUEBLACK = vec4(0, 0, 0, 1), |
|||
|
|||
-- hues |
|||
BLUE_STONE = vec4(0.12, 0.3, 0.3, 1), |
|||
MYRTLE = vec4(0.10, 0.25, 0.10, 1), |
|||
BROWN_POD = vec4(0.25, 0.20, 0.10, 1), |
|||
BOTTLE_GREEN = vec4(0.15, 0.30, 0.20, 1), |
|||
MAGENTA = vec4(1, 0, 1, 1) |
|||
} |
|||
|
@ -0,0 +1,9 @@ |
|||
|
|||
function math.wrapf(float, range) |
|||
return float - range * math.floor(float / range) |
|||
end |
|||
|
|||
function math.lerpv2(v1, v2, t) |
|||
return v1 * t + v2 * (1 - t) |
|||
end |
|||
|
@ -0,0 +1,14 @@ |
|||
|
|||
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 |
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
|
|||
function table.rchoice(t) |
|||
return t[math.floor(math.random() * #t) + 1] |
|||
end |
|||
|
|||
function table.find(t, predicate) |
|||
for i,v in pairs(t) do |
|||
if predicate(v) then |
|||
return i,v |
|||
end |
|||
end |
|||
return nil |
|||
end |
|||
|
@ -0,0 +1,5 @@ |
|||
|
|||
function load_textures() |
|||
TEX_MOB1_1 = am.texture2d("../res/mob1_1.png") |
|||
end |
|||
|
@ -1,6 +1,10 @@ |
|||
|
|||
function lerp(v1, v2, t) |
|||
return v1 * t + v2 * (1 - t) |
|||
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 |
|||
|
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue