|
@@ -24,12 +24,6 @@ local player = {
|
|
|
gunpods={},
|
|
|
}
|
|
|
|
|
|
-local grad_palettes = {
|
|
|
- { 1, 2, 3, 4, 12 },
|
|
|
- { 7, 6, 5, 4, 12 },
|
|
|
- { 8, 9, 10, 11, 12 },
|
|
|
-}
|
|
|
-
|
|
|
local enemies = {}
|
|
|
|
|
|
function add_enemy(en_type, xpos, ypos)
|
|
@@ -44,22 +38,6 @@ function mod(a, b)
|
|
|
return math.floor(a-(math.floor(a/b)*b))
|
|
|
end
|
|
|
|
|
|
-function draw_gradient(xpos, ypos, width, height, startindex, gradient)
|
|
|
- local idx = startindex or 1
|
|
|
- local grad = gradient or 1
|
|
|
- local band_w = width / 5 --# of colors in each gradient
|
|
|
- local cur_band = 0
|
|
|
- for i=0,width-1 do
|
|
|
- if cur_band >= band_w then
|
|
|
- idx = idx + 1
|
|
|
- cur_band = 0
|
|
|
- end
|
|
|
- cur_band = cur_band + 1
|
|
|
- if idx > 5 then idx = 1 end
|
|
|
- line(xpos + i, ypos, xpos + i - height, ypos + height, grad_palettes[grad][idx])
|
|
|
- end
|
|
|
-end
|
|
|
-
|
|
|
-- TODO: various types
|
|
|
function add_bullet()
|
|
|
sfx(0, 'D-6', 10, 0, 11, 4)
|
|
@@ -193,6 +171,13 @@ function handle_input()
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+function check_aabb(x1, y1, w1, h1, x2, y2, w2, h2)
|
|
|
+ return x1 < x2+w2 and
|
|
|
+ x2 < x1+w1 and
|
|
|
+ y1 < y2+h2 and
|
|
|
+ y2 < y1+h1
|
|
|
+end
|
|
|
+
|
|
|
function TIC()
|
|
|
handle_input()
|
|
|
|
|
@@ -207,7 +192,6 @@ function TIC()
|
|
|
draw_player()
|
|
|
draw_bullets()
|
|
|
|
|
|
- draw_gradient(10, 40, 10, 5, mod(t/3, 5) + 1, player.gun_type)
|
|
|
|
|
|
dbg("type:"..tostring(player.gun_type), 0)
|
|
|
dbg(tostring(player.fire_held), 1)
|
|
@@ -229,12 +213,26 @@ end
|
|
|
-- 005:000000000022000002332eef23dd31f0231ddddd0fe1eee00022000000000000
|
|
|
-- 006:000000000022000002dd2000231ddddd23e1eeee02ee20000022000000000000
|
|
|
-- 007:0000000000de00000f1ddddd2341eee02344320002331ee00f1eeddd00000000
|
|
|
+-- 008:000000000000000000000000aa99aabb99aabbaa000000000000000000000000
|
|
|
-- 016:dccefeed0ddddefa0fcccc8acf9deededfbbcddd0000bcdd00008ccc00000dd0
|
|
|
-- 017:d00000009eedd000aaaaeecc9aa9dccdddcccdf0ccd00000d000000000000000
|
|
|
-- 018:0000000000000880000889ab08899abc000889ab000008800000000000000000
|
|
|
+-- 019:0ee000dcedce0deeecde0eaa0eeeaa98000a98880eea8888eea98888dea88888
|
|
|
+-- 020:0ee000dcedbe0deeebde0eaa0eeeaa98000a98880eea8888eea98888dea88888
|
|
|
+-- 021:0ee000dcedce0deeecde0e550eee44ff0004ffff0ee4ffffee5fffffde5fffff
|
|
|
+-- 022:0022220002223320122344321223443212223322112222210112221000111100
|
|
|
+-- 023:00aaaa000aaabb609aabccba9aabccba9aaabbaa99aaaaa9099aaa9000999900
|
|
|
+-- 024:0066660006665560766544567665445676665566776666670776667000777700
|
|
|
+-- 025:00bccb000ab00ba00ab000000abccb0000bccba000000ba00ab00ba000bccb00
|
|
|
+-- 026:0000000023200232233cc332233cc332230cc032230000322300003200000000
|
|
|
-- 032:ecdf00000edddf0000edddc00bbcfeeddcc99feeee8888880bc99f99000bfeee
|
|
|
-- 033:000000000000000009aa0000cdc99e00eeedddcc88888eef9eeeedd0df000000
|
|
|
-- 034:00000000000000000000089a000089ab0000089a000000000000000000000000
|
|
|
+-- 035:0ee000dcedce0deeecde0e330eee3321000321110ee31111ee321111de311111
|
|
|
+-- 036:0ee000dced3e0deee3de0e330eee3321000321110ee31111ee321111de311111
|
|
|
+-- 037:00cccc000cccccc0c000000c0000000000000000000000000000000000000000
|
|
|
+-- 038:000000000000000000ccccc00ccccccc0ccccccc00ccccc00000000000000000
|
|
|
+-- 039:00000000000000000000000000000000c000000c0cccccc000cccc0000000000
|
|
|
-- 050:00000000000099a000889abb8889accc00889abb000099a00000000000000000
|
|
|
-- </SPRITES>
|
|
|
|