Browse Source

asset updates mostly

pixelbath 5 months ago
parent
commit
24ef9d8dc7

+ 25 - 3
dark/lighttest.lua

@@ -6,12 +6,34 @@
 -- version: 0.1
 -- script:  lua
 
+local entities = {
+    { x=30, y=20, spr=256, w=2, h=2, },
+    { x=90, y=60, spr=256, w=2, h=2, },
+    { x=150, y=80, spr=258, w=2, h=2, },
+}
+
+function get_distance(x1, y1, x2, y2)
+    return math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1))
+end
+
 function draw_base()
-    spr(256, 30, 20, 0, 1, 0, 0, 2, 2)
-    spr(256, 90, 60, 0, 1, 0, 0, 2, 2)
-    spr(258, 150, 80, 0, 1, 0, 0, 2, 2)
+    local mx,my = mouse()
+    for key,val in ipairs(entities) do
+        spr(val.spr, val.x, val.y, 0, 1, 0, 0, val.w, val.h)
+        for x=0,val.w*8-1 do
+            --only do this for filled pixels
+            if pix(val.x + x, val.y) == 12 then
+                local dist = get_distance(val.x + x, val.y, mx, my)
+                
+            end
+        end
+    end
 end
 
+-- Step 1: get an SDF working for various sprites
+-- Step 2: calculate lighting for each white pixel in sprite by marching from pixel to light(s)
+-- Step 3: color any pixel over a lighting threshold
+
 function draw_lighting()
     local mx,my,lmb = mouse()
     if lmb then return end

BIN
einhander/einhander.aseprite


BIN
mule/mule-iso.aseprite


+ 0 - 104
quickplat/quickplat.lua

@@ -1,104 +0,0 @@
--- title:  quickplat
--- author: game developer
--- desc:   quick platforming tests
--- script: lua
-
-t=0
-x=96
-y=24
-
-local airAccel = 0
-local airControl = 0
-local airBrake = 0
-
-local runAccel = 0.2
-local runTurnSpeed = 0
-local runDecel = 0.2
-local runMaxSpeed = 1
-
-local cameraDampX = 0
-local cameraDampY = 0
-local cameraLookAhead = 0
-
-local jumpBufferTime = 0
-local jumpMaxFallSpeed = 5
-local jumpCoyoteTime = 0
-local jumpMaxHeight = 20
-local jumpVariableHeight = true
-local jumpGravity = 0.7
-
-local player = {
-	x = 10, y = 80,
-	vx = 0, vy = 0,
-	jump = 2.3,
-}
-
-local gravity = -0.07
-
-function TIC()
-	movePlayer()
-
-	cls(0)
-	drawPlayer()
-
-	t=t+1
-end
-
-function movePlayer()
-	-- if btn(0) then player.y=player.y-1 end
-	-- if btn(1) then player.y=player.y+1 end
-	if btn(2) then
-		player.vx = math.min(-runMaxSpeed, player.vx - runAccel)
-	end
-	if btn(3) then
-		player.vx = math.max(runMaxSpeed, player.vx + runAccel)
-	end
-	
-	if player.vy == 0 and btnp(4) then
-		player.vy = -player.jump
-	end
-
-	-- friction and gravity
-	player.x = player.x + player.vx
-	player.vx = player.vx * runDecel
-
-	player.vy = player.vy - gravity
-	player.y = player.y + player.vy
-
-	if player.y > 130 then
-		player.y = 130
-		player.vy = 0
-	end
-end
-
-function drawPlayer()
-	rect(player.x, player.y, 8, 8, 7)
-end
-
--- <TILES>
--- 001:5555555566666666222222222222222222222222222222222222222222222222
--- 002:5555555066666665222222262222222022222220222222202222222022222220
--- </TILES>
-
--- <MAP>
--- 015:101010101010101010101010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
--- </MAP>
-
--- <WAVES>
--- 000:00000000ffffffff00000000ffffffff
--- 001:0123456789abcdeffedcba9876543210
--- 002:0123456789abcdef0123456789abcdef
--- </WAVES>
-
--- <SFX>
--- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
--- </SFX>
-
--- <FLAGS>
--- 000:00202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
--- </FLAGS>
-
--- <PALETTE>
--- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
--- </PALETTE>
-

+ 28 - 0
shmup/level1.tmx

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="128" height="20" tilewidth="8" tileheight="8" infinite="0" nextlayerid="2" nextobjectid="1">
+ <tileset firstgid="1" source="tiles.tsx"/>
+ <layer id="1" name="Tile Layer 1" width="128" height="20">
+  <data encoding="csv">
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741830,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741829,1073741830,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,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,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,1073741826,1073741827,1073741828,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,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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,2,3,4,2,3,8,19,20,21,2,3,7,8,7,7,8,4,3,2,3,4,2,3,4,3,4,3,4,3,4,2,3,4,2,3,4,2,3,4,3,4,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,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,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,0,0,0,0
+</data>
+ </layer>
+</map>

BIN
shmup/shmup.aseprite


BIN
shmup/tiles.png


+ 4 - 0
shmup/tiles.tsx

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tileset version="1.9" tiledversion="1.9.2" name="tiles" tilewidth="8" tileheight="8" tilecount="256" columns="16">
+ <image source="tiles.png" width="128" height="128"/>
+</tileset>

+ 2 - 2
survivor/survivor.lua

@@ -1,6 +1,6 @@
 -- title:  survivor
 -- author: pixelbath
--- desc:   a game where you try not to die
+-- desc:   an overhead game where you try not to die
 
 local t = 0
 
@@ -37,7 +37,7 @@ end
 -- also update here to save a loop
 function draw_enemies()
     for k, en in ipairs(enemies) do
-        rect(en.x, en.y, 8, 8, 3)
+        rect(en.x + cam.x, en.y + cam.y, 8, 8, 3)
 
         if en.x > p.x and en.x < p.x + 8 and en.y > p.y and en.y < p.y + 8 then
             p.hp = p.hp - 1

+ 2 - 10
tinyablo/tinyablo.lua

@@ -3,6 +3,8 @@
 -- desc:   isometric stuff
 -- script: lua
 
+-- references: The Immortal (NES), Solstice (NES)
+
 t=0
 
 p = {
@@ -76,16 +78,6 @@ end
 -- 017:c0000000c0000000c0000000cc0000000c000000000000000000000000000000
 -- </SPRITES>
 
--- <WAVES>
--- 000:00000000ffffffff00000000ffffffff
--- 001:0123456789abcdeffedcba9876543210
--- 002:0123456789abcdef0123456789abcdef
--- </WAVES>
-
--- <SFX>
--- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
--- </SFX>
-
 -- <PALETTE>
 -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
 -- </PALETTE>