|
@@ -0,0 +1,92 @@
|
|
|
|
+-- title: isoshit
|
|
|
|
+-- author: pixelbath
|
|
|
|
+-- desc: isometric stuff
|
|
|
|
+-- script: lua
|
|
|
|
+
|
|
|
|
+t=0
|
|
|
|
+
|
|
|
|
+p = {
|
|
|
|
+ x = 10,
|
|
|
|
+ y = 10,
|
|
|
|
+ spr = 0,
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+skeleton = {
|
|
|
|
+ spr = 256,
|
|
|
|
+ x = 3, y = 4,
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+map = {
|
|
|
|
+ { 2, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+function handle_mouse()
|
|
|
|
+ mx, my, pl, pm, pr = mouse()
|
|
|
|
+
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+function map2screen(mapx, mapy)
|
|
|
|
+ return (mapx-mapy-1) * 8 - p.x, (mapx+mapy-1) * 4 - p.y
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+function update()
|
|
|
|
+ for ky,yt in pairs(map) do
|
|
|
|
+ for kx,xt in pairs(yt) do
|
|
|
|
+ xtile, ytile = map2screen(kx, ky)
|
|
|
|
+ spr(map[kx][ky], xtile, ytile, 0, 1, 0, 0, 2, 1)
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+function TIC()
|
|
|
|
+ cls(0)
|
|
|
|
+
|
|
|
|
+ if (btn(0)) then p.y = p.y - 1 end
|
|
|
|
+ if (btn(1)) then p.y = p.y + 1 end
|
|
|
|
+ if (btn(2)) then p.x = p.x - 1 end
|
|
|
|
+ if (btn(3)) then p.x = p.x + 1 end
|
|
|
|
+
|
|
|
|
+ -- draw tiles
|
|
|
|
+ local xtile = 0
|
|
|
|
+ local ytile = 0
|
|
|
|
+
|
|
|
|
+ update()
|
|
|
|
+ t=t+1
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+-- <TILES>
|
|
|
|
+-- 000:0000006600006666006666666666666600666666000066660000006600000000
|
|
|
|
+-- 001:6600000066660000666666006666666666666600666600006600000000000000
|
|
|
|
+-- 002:000000ee0000eeee00eeeeeeeeeeeeee00eeeeee0000eeee000000ee00000000
|
|
|
|
+-- 003:ee000000eeee0000eeeeee00eeeeeeeeeeeeee00eeee0000ee00000000000000
|
|
|
|
+-- </TILES>
|
|
|
|
+
|
|
|
|
+-- <SPRITES>
|
|
|
|
+-- 000:0000000c000000cc000000cc000000cc00000c0c000000cc0000000c0000000c
|
|
|
|
+-- 001:0000000000000000c0000000ccc00000c00000000000000000000000c0000000
|
|
|
|
+-- 016:000000cc000000c0000000c0000000c0000000c0000000c00000000000000000
|
|
|
|
+-- 017:c0000000c0000000c0000000cc0000000c000000000000000000000000000000
|
|
|
|
+-- </SPRITES>
|
|
|
|
+
|
|
|
|
+-- <WAVES>
|
|
|
|
+-- 000:00000000ffffffff00000000ffffffff
|
|
|
|
+-- 001:0123456789abcdeffedcba9876543210
|
|
|
|
+-- 002:0123456789abcdef0123456789abcdef
|
|
|
|
+-- </WAVES>
|
|
|
|
+
|
|
|
|
+-- <SFX>
|
|
|
|
+-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
|
|
|
|
+-- </SFX>
|
|
|
|
+
|
|
|
|
+-- <PALETTE>
|
|
|
|
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
|
|
|
|
+-- </PALETTE>
|
|
|
|
+
|