Compare commits

..

33 Commits

Author SHA1 Message Date
29b18f031c - Commit pa probar 2026-05-01 16:12:04 +02:00
0f7a8359ea - Commit imèsil 2026-05-01 08:46:03 +02:00
47675d70b4 canvi de comp 2026-04-15 18:05:12 +02:00
244a09c7ed - [WIP] titles 2026-04-15 17:32:57 +02:00
3ca9f28021 - [FIX] arreglos en alguna habitació
- [NEW] particles quan la bala rebota
2026-04-14 21:46:05 +02:00
59fb6faa95 - [NEW] Més tiles
- [WIP] Habitacions al 81%
2026-04-14 12:39:03 +02:00
e040a3896d - [NEW] Rat penat 2026-04-14 10:10:08 +02:00
f3417d6faa - [FIX] draw_sprite_selected pintava mal el reborde de formiguetes (per el nou subpal) 2026-04-13 20:12:58 +02:00
1844901d6f - [NEW] Habitacions al 75% 2026-04-13 18:37:40 +02:00
44398f3080 - [NEW] afegit dimoni 2026-04-13 12:01:22 +02:00
90f66a4cdc - [FIX] Reajustat launch.json per al mini-debugger de release 2026-04-13 11:08:23 +02:00
8a80bffe42 - [NEW] Adaptat a l'última versió de mini (1.5.dev) 2026-04-12 11:47:22 +02:00
1a4041a231 - [FIX] Amb la nova versió de mini, com el color transparent es el final, al reemplaçar tota la paleta pintava totes les sombres com blocs negres. 2026-04-03 21:30:03 +02:00
300d2b28df - [FIX] Si mories disparant, al resucitar no podies moure't... com en la vida real! 2026-03-31 14:01:36 +02:00
7b080c2921 - [WIP] Treball de recolçament a mini-debugger 2026-03-30 23:03:53 +02:00
5a50a29bdb -- Ajuda al desenvolupament de mini-debugger ---
- [NEW] Canviat de sys.beat a sys.chrono
- [NEW] Mostrant fps
2026-03-30 14:07:58 +02:00
01fff47b57 - Treballant en el debugger de mini 2026-03-29 20:00:18 +02:00
64cbda695c - [NEW] Habitacions al 67% 2026-03-28 19:52:30 +01:00
51f267284e - [FIX] Retocs en habitacions
- [FIX] Quan mor, reapareix en l'habitació que toca
- [FIX] Després de morir, al agafar una clau es tornava tot roig infern (que por)
- [FIX] Si no hi havia objectes amb llum en l'habitació on mories, mai resucitaves
- [FIX] Al resucitar, totes les llums s'encenen desde cero, no nomes la teua
- [FIX] Quan t'havien pegat, no podies disparar durant el cooldown
- [FIX] Menos posibilitats de que la "safe position" estiga en un lloc mortal
2026-03-27 20:37:06 +01:00
49396331a7 - [FIX] Fora la puta escala (canvi de comp) 2026-03-27 17:40:14 +01:00
5f465b2a74 - [NEW] El marcador s'amaga quan mors
- [NEW] Al morir i apagar-se tot, les llums s'encenen de cero a normal de nou al reviure
2026-03-27 14:02:41 +01:00
797d407539 - [NEW] Habitacions al 64% 2026-03-27 13:26:43 +01:00
5b4e4be005 - [NEW] Més gràfics
- [NEW] Retocs en habitacions
2026-03-26 17:46:32 +01:00
8b33e35114 - [FIX] Color mal ficat en algúns gifs
- [NEW] Més tiles
- [NEW] Habitacions al 53%
2026-03-26 13:21:27 +01:00
9c9092d19b - [NEW] Berserk implementat
- [NEW] Millorats detalls en habitacions
- [NEW] Habitacions al 44%
2026-03-25 13:42:30 +01:00
4e7a50879e - [NEW] Més tiles
- [FIX] L'heroi se clavaba en les pareds quan li pegaven
- [NEW] Alguns fondos enhancechats
- [FIX] Augmentada la velocitat de Nemesio
- [NEW] Shortcuts de teclat per a canviar de mode a l'editor
- [NEW] Habitacions al 40%
2026-03-24 19:01:32 +01:00
c1f5f92dae - [FIX] Ajustats alguns "edge cases" de algunes habitacions
- [FIX] Ajustada la diferència de cadència entre gotes
- [FIX] Ajustat el nivell de l'aigua, que fallaba l'ultima linia
2026-03-24 13:58:07 +01:00
cee6ade851 - [FIX] La rata no pasaba per un hueco de 8 pixels de alt
- [FIX] Al tornar de l'editor, resetejar hero.invisible
- [NEW] Habitacions al 38%
2026-03-24 13:36:20 +01:00
50f2710986 - [FIX] l'heroi podia clavar-se pel tile de dalt d'una corda 2026-03-24 13:11:48 +01:00
8853bca713 - [NEW] Un montó de tiles nous
- [FIX] No es podía botar des de la corda
- [NEW] Habitacions al 34%
2026-03-24 12:29:58 +01:00
af269366c2 - [NEW] Alguna habitació més i retocts en altres 2026-03-23 22:45:02 +01:00
a98a46a3d2 - [NEW] guardem una safe_pos al entrar en cada habitació
- [FIX] Al morir, o tornar al editor, se reseteja l'heroi
- [FIX] Ja no canvia d'habitació al asomar el cabet per dalt al botar
- [NEW] Més habitacions (21%)
2026-03-23 18:46:27 +01:00
130c5d62e1 - [WIP] Més habitacions 2026-03-23 14:01:54 +01:00
48 changed files with 582 additions and 71 deletions

13
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Mini Game",
"type": "mini-debugger",
"request": "launch",
"program": "${workspaceFolder}/mini_debug",
"cwd": "${workspaceFolder}",
}
]
}

BIN
data/gfx/abad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

BIN
data/gfx/berserk.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 228 B

BIN
data/gfx/dimoni.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 826 B

BIN
data/gfx/paku.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
data/gfx/ratpenat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

BIN
data/gfx/titles/jgmummy.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

BIN
data/gfx/titles/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
data/gfx/titles/pharao.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 228 B

View File

@@ -1,6 +1,7 @@
require "utils.app" require "utils.app"
require "modules.score" require "modules.score"
require "modules.rooms" require "modules.rooms"
require "stages.titles"
require "stages.editor" require "stages.editor"
require "stages.game" require "stages.game"
require "utils.palfade" require "utils.palfade"
@@ -21,11 +22,13 @@ function mini.init()
rooms.init() rooms.init()
shader.init("lynx.glsl") shader.init("lynx.glsl")
if sys.debug() then --titles.enable()
editor.enable()
else
game.enable() game.enable()
end --if sys.debug() then
-- editor.enable()
--else
-- game.enable()
--end
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -54,6 +54,13 @@ animations = {
{ frame={x=156,y=0,w=4,h=3}, wait=4 } { frame={x=156,y=0,w=4,h=3}, wait=4 }
} }
}, },
["particle"] = {
cycle = {1},
loop = false,
frames = {
{ frame={x=112,y=0,w=8,h=8}, wait=100 }
}
},
["mummy_walk"] = { ["mummy_walk"] = {
cycle = {1,2,1,3}, cycle = {1,2,1,3},
loop = true, loop = true,
@@ -232,4 +239,30 @@ animations = {
{ frame={x=56,y=0,w=8,h=8}, wait=100 } { frame={x=56,y=0,w=8,h=8}, wait=100 }
} }
}, },
["abad"] = {
cycle = {1,2},
loop = true,
frames = {
{ frame={x=16,y=0,w=16,h=18}, offset={flipped={x=0,y=-2}}, wait=2 },
{ frame={x=32,y=0,w=16,h=18}, offset={flipped={x=0,y=-2}}, wait=2 }
}
},
["dimoni_walk"] = {
cycle = {1,2,1,3},
loop = true,
frames = {
{ frame={x=0,y=0,w=16,h=17}, offset={normal={x=0,y=-2}, flipped={x=0,y=-2}}, wait=4 },
{ frame={x=16,y=0,w=16,h=17}, offset={normal={x=0,y=-2}, flipped={x=0,y=-2}}, wait=4 },
{ frame={x=32,y=0,w=16,h=17}, offset={normal={x=0,y=-2}, flipped={x=0,y=-2}}, wait=4 }
}
},
["ratpenat"] = {
cycle = {1,2,3,2},
loop = true,
frames = {
{ frame={x=0,y=0,w=8,h=8}, wait=4 },
{ frame={x=8,y=0,w=8,h=8}, wait=4 },
{ frame={x=16,y=0,w=8,h=8}, wait=4 }
}
},
} }

View File

@@ -0,0 +1,58 @@
function ia.update_berserk(spr)
map.surf(rooms.surf_foreground)
if spr.state == templates.ALIVE then
if sprites.hero.state == templates.ALIVE then
local x1,y1,w1,h1 = util.aabb(spr) -- El meu aabb
local x2,y2,w2,h2 = util.aabb(sprites.hero) -- el aabb del heroi
-- Si toca al heroi...
if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then
sprites.hero.hit()
spr.flipped = not spr.flipped
end
end
local advance = 1
if sprites.hero.pos.y == spr.pos.y-1 then advance = 2 end
if spr.flipped then
local tx, ty = (spr.pos.x+3)>>3, (spr.pos.y+15)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x - advance
else
spr.flipped = not spr.flipped
end
else
local tx, ty = (spr.pos.x+12)>>3, (spr.pos.y+15)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x + advance
else
spr.flipped = not spr.flipped
end
end
elseif spr.state == templates.DYING then
if spr.animation ~= "mummy_dying" then
sprites.set_animation(spr, "mummy_dying")
spr.surf = surf.load("gfx/mummy.gif")
else
if spr.current_frame == 8 then
sprites.set_animation(spr, "mummy_dead")
spr.state = templates.DEAD
end
end
elseif spr.state == templates.DEAD then
if spr.current_wait == 1 then
sprites.set_animation(spr, "mummy_undying")
spr.state = templates.RESURRECTING
end
elseif spr.state == templates.RESURRECTING then
if spr.current_frame == 13 then
sprites.set_animation(spr, "mummy_walk")
spr.surf = surf.load("gfx/berserk.gif")
spr.state = templates.ALIVE
end
end
end

View File

@@ -9,7 +9,13 @@ function ia.update_bullet(spr)
if v.enemy and v.state ~= templates.DEAD then if v.enemy and v.state ~= templates.DEAD then
local x2,y2,w2,h2 = util.aabb(v) local x2,y2,w2,h2 = util.aabb(v)
if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then
if v.state == templates.ALIVE then v.state = templates.DYING end if v.state == templates.ALIVE then
if v.bulletproof then
bullet_ricochet(spr)
else
v.state = templates.DYING
end
end
sprites.remove(spr) sprites.remove(spr)
return return
end end
@@ -23,7 +29,15 @@ function ia.update_bullet(spr)
spr.pos.x = spr.pos.x + 8 spr.pos.x = spr.pos.x + 8
end end
else else
sprites.remove(spr) bullet_ricochet(spr)
--sprites.remove(spr)
end end
end end
function bullet_ricochet(spr)
sprites.remove(spr)
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x= 1,y= math.random(3,5)}, flipped=spr.flipped}))
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x=-1,y= math.random(3,5)}, flipped=spr.flipped}))
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x=-1,y=-math.random(3,5)}, flipped=spr.flipped}))
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x= 1,y=-math.random(3,5)}, flipped=spr.flipped}))
end

View File

@@ -0,0 +1,31 @@
function ia.update_dimoni(spr)
map.surf(rooms.surf_foreground)
if spr.state == templates.ALIVE then
if sprites.hero.state == templates.ALIVE then
local x1,y1,w1,h1 = util.aabb(spr) -- El meu aabb
local x2,y2,w2,h2 = util.aabb(sprites.hero) -- el aabb del heroi
-- Si toca al heroi...
if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then
sprites.hero.hit()
spr.flipped = not spr.flipped
end
end
if spr.flipped then
local tx, ty = (spr.pos.x+3)>>3, (spr.pos.y+15)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x - 1
else
spr.flipped = not spr.flipped
end
else
local tx, ty = (spr.pos.x+12)>>3, (spr.pos.y+15)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x + 1
else
spr.flipped = not spr.flipped
end
end
end
end

View File

@@ -2,6 +2,9 @@
function ia.update_gota(spr) function ia.update_gota(spr)
if spr.timer > 0 then if spr.timer > 0 then
spr.timer = spr.timer-1 spr.timer = spr.timer-1
if spr.timer == 0 then
sprites.set_animation(spr, "gota_generador")
end
return return
else else
spr.invisible = nil; spr.invisible = nil;

View File

@@ -28,6 +28,11 @@ function ia.update_hero()
local move_anim = "hero_walk" local move_anim = "hero_walk"
-- Si estem en cooldown desde l'ultim dispar, decrementem el contador -- Si estem en cooldown desde l'ultim dispar, decrementem el contador
-- Si estem en cooldown desde l'ultim dispar, decrementem el contador
if sprites.hero.gun_cooldown > 0 then
sprites.hero.gun_cooldown = sprites.hero.gun_cooldown - 1
end
if sprites.hero.cooldown > 0 then if sprites.hero.cooldown > 0 then
sprites.hero.cooldown = sprites.hero.cooldown - 1 sprites.hero.cooldown = sprites.hero.cooldown - 1
end end
@@ -52,19 +57,19 @@ function ia.update_hero()
-- Si li han pegat... -- Si li han pegat...
if sprites.hero.has_been_hit then if sprites.hero.has_been_hit then
if sprites.hero.flipped then if sprites.hero.flipped then
local tx, ty = (sprites.hero.pos.x+3)>>3, (sprites.hero.pos.y+16)>>3 local tx, ty = (sprites.hero.pos.x+12)>>3, (sprites.hero.pos.y+16)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
if tx<rooms.pos.x then if tx>rooms.pos.x+19 then
game.change_room(-1,0) game.change_room(1,0)
else else
sprites.hero.pos.x = sprites.hero.pos.x + 1 sprites.hero.pos.x = sprites.hero.pos.x + 1
end end
end end
else else
local tx, ty = (sprites.hero.pos.x+12)>>3, (sprites.hero.pos.y+16)>>3 local tx, ty = (sprites.hero.pos.x+3)>>3, (sprites.hero.pos.y+16)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
if tx>rooms.pos.x+19 then if tx<rooms.pos.x then
game.change_room(1,0) game.change_room(-1,0)
else else
sprites.hero.pos.x = sprites.hero.pos.x - 1 sprites.hero.pos.x = sprites.hero.pos.x - 1
end end
@@ -94,12 +99,12 @@ function ia.update_hero()
local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3 local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3
--draw.rect(tx1<<3,ty<<3,8,8,8) --draw.rect(tx1<<3,ty<<3,8,8,8)
--draw.rect(tx2<<3,ty<<3,8,8,28) --draw.rect(tx2<<3,ty<<3,8,8,28)
if map.tile(tx1,ty) == 0 and map.tile(tx2,ty) == 0 then if map.tile(tx1,ty) < 16 and map.tile(tx2,ty) < 16 then
if ty+1<rooms.pos.y then --if ty+1<rooms.pos.y then
game.change_room(0,-1) -- game.change_room(0,-1)
else --else
if sprites.hero.jumping > 1 then sprites.hero.pos.y = sprites.hero.pos.y - 1 end if sprites.hero.jumping > 1 then sprites.hero.pos.y = sprites.hero.pos.y - 1 end
end --end
else else
sprites.hero.jumping = 0 sprites.hero.jumping = 0
sprites.hero.jump_throttle = 10 sprites.hero.jump_throttle = 10
@@ -115,8 +120,8 @@ function ia.update_hero()
-- SI PULSA AMUNT... -- SI PULSA AMUNT...
if key.down(key.UP) or pad.down(pad.UP) then if key.down(key.UP) or pad.down(pad.UP) then
anim = move_anim anim = move_anim
local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3 local tx1, tx2, ty = (sprites.hero.pos.x+8)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3
if map.tile(tx1,ty) < 16 or map.tile(tx2,ty) < 16 then if map.tile(tx1,ty) < 16 then --or map.tile(tx2,ty) < 16 then
if ty+1<rooms.pos.y then if ty+1<rooms.pos.y then
game.change_room(0,-1) game.change_room(0,-1)
else else
@@ -163,8 +168,11 @@ function ia.update_hero()
local broken_tile = templates.create("brick", {pos={x=tx2<<3, y=(ty+2)<<3}, flipped=sprites.hero.flipped}) local broken_tile = templates.create("brick", {pos={x=tx2<<3, y=(ty+2)<<3}, flipped=sprites.hero.flipped})
table.insert(sprites.list, broken_tile) table.insert(sprites.list, broken_tile)
end end
if tile_under_me1>=16 or tile_under_me1>=16 then
sprites.hero.pos.y = (ty<<3)-1 sprites.hero.pos.y = (ty<<3)-1
end
anim = "hero_stand" anim = "hero_stand"
if sprites.hero.state == templates.ALIVE then sprites.save_safe_pos() end
-- SI ESTÀ SOBRE UNES ESCALERES I POLSA AVALL... -- SI ESTÀ SOBRE UNES ESCALERES I POLSA AVALL...
if (map.tile(txm,ty+2) < 16 and map.tile(txm,ty+2) > 0) then if (map.tile(txm,ty+2) < 16 and map.tile(txm,ty+2) > 0) then
if key.down(key.DOWN) or pad.down(pad.DOWN) then if key.down(key.DOWN) or pad.down(pad.DOWN) then
@@ -181,9 +189,9 @@ function ia.update_hero()
sprites.hero.jumping = 17 sprites.hero.jumping = 17
-- SI POLSA DISPAR... -- SI POLSA DISPAR...
elseif (sprites.hero.cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then elseif (sprites.hero.gun_cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then
sprites.hero.shooting = true sprites.hero.shooting = true
sprites.hero.cooldown = 20 sprites.hero.gun_cooldown = 20
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped}) local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
table.insert(sprites.list, bullet) table.insert(sprites.list, bullet)
anim = "hero_shoot" anim = "hero_shoot"
@@ -241,6 +249,7 @@ function ia.hero_hit(live)
if sprites.hero.lives == 0 then if sprites.hero.lives == 0 then
sprites.hero.state = templates.DEAD sprites.hero.state = templates.DEAD
sprites.hero.invisible = nil
sprites.hero.surf = surf.load("gfx/mummy.gif") sprites.hero.surf = surf.load("gfx/mummy.gif")
sprites.set_animation(sprites.hero, "mummy_dying") sprites.set_animation(sprites.hero, "mummy_dying")
sprites.hero.jumping = 0 sprites.hero.jumping = 0
@@ -261,3 +270,20 @@ function ia.hero_give_key(color)
tweening.add(1,0,0.25,easing.linear,function(value,n,finished)palfade.fade_white(value)end) tweening.add(1,0,0.25,easing.linear,function(value,n,finished)palfade.fade_white(value)end)
return true return true
end end
function ia.hero_reset()
sprites.hero.state = templates.ALIVE
sprites.hero.invisible = nil
sprites.hero.lives = 4
sprites.hero.surf = surf.load("gfx/morcus.gif")
sprites.hero.animation = "hero_stand"
sprites.hero.current_frame = 1
sprites.hero.current_wait = 1
sprites.hero.flipped = false
sprites.hero.light = 100
sprites.hero.pos = {x=sprites.last_safe_pos.x,y=sprites.last_safe_pos.y}
sprites.hero.shooting = false
rooms.go_to_room(sprites.last_safe_room)
palfade.init()
end

View File

@@ -15,7 +15,7 @@ function ia.update_nemesio(spr)
if spr.substate == nemesio.STATIC then if spr.substate == nemesio.STATIC then
spr.mode = draw.NORMAL spr.mode = draw.NORMAL
if spr.timer==100 then if spr.timer==50 then
spr.timer=0 spr.timer=0
spr.substate = nemesio.FLOATING spr.substate = nemesio.FLOATING
spr.advance = {x=0,y=0} spr.advance = {x=0,y=0}

View File

@@ -13,14 +13,14 @@ function ia.update_rata(spr)
if spr.flipped then if spr.flipped then
local tx, ty = (spr.pos.x-1)>>3, (spr.pos.y+7)>>3 local tx, ty = (spr.pos.x-1)>>3, (spr.pos.y+7)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then if map.tile(tx,ty) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x - 1 spr.pos.x = spr.pos.x - 1
else else
spr.flipped = not spr.flipped spr.flipped = not spr.flipped
end end
else else
local tx, ty = (spr.pos.x+9)>>3, (spr.pos.y+7)>>3 local tx, ty = (spr.pos.x+9)>>3, (spr.pos.y+7)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then if map.tile(tx,ty) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x + 1 spr.pos.x = spr.pos.x + 1
else else
spr.flipped = not spr.flipped spr.flipped = not spr.flipped

View File

@@ -0,0 +1,29 @@
function ia.update_ratpenat(spr)
map.surf(rooms.surf_foreground)
if sprites.hero.state == templates.ALIVE then
local x1,y1,w1,h1 = util.aabb(spr) -- El meu aabb
local x2,y2,w2,h2 = util.aabb(sprites.hero) -- el aabb del heroi
-- Si toca al heroi...
if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then
sprites.hero.hit()
spr.flipped = not spr.flipped
end
end
if spr.flipped then
local tx, ty = (spr.pos.x-1)>>3, (spr.pos.y)>>3
if map.tile(tx,ty) < 16 then
spr.pos.x = spr.pos.x - 1
else
spr.flipped = not spr.flipped
end
else
local tx, ty = (spr.pos.x+9)>>3, (spr.pos.y)>>3
if map.tile(tx,ty) < 16 then
spr.pos.x = spr.pos.x + 1
else
spr.flipped = not spr.flipped
end
end
end

View File

@@ -17,4 +17,8 @@ items = {
{ name="nemesio", label="nemesio", visual={x=16, y=80, w=16, h=16} }, { name="nemesio", label="nemesio", visual={x=16, y=80, w=16, h=16} },
{ name="rata", label="rata", visual={x=80, y=48, w=9, h=8} }, { name="rata", label="rata", visual={x=80, y=48, w=9, h=8} },
{ name="gota", label="gota", visual={x=80, y=56, w=8, h=8} }, { name="gota", label="gota", visual={x=80, y=56, w=8, h=8} },
{ name="berserk", label="berserk", visual={x=16, y=24, w=16, h=16} },
{ name="abad", label="abad", visual={x=16, y=0, w=16, h=16} },
{ name="dimoni", label="dimoni", visual={x=32, y=0, w=16, h=17} },
{ name="ratpenat", label="ratpenat", visual={x=16, y=64, w=8, h=8} },
} }

View File

@@ -22,7 +22,7 @@ function me.draw()
local sel = me.selected local sel = me.selected
view.origin(0,me.pos_y) view.origin(0,me.pos_y)
view.clip() surf.clip()
local y = me.pos_y local y = me.pos_y
draw.rrectf(1,0,8,8,1,21) draw.rrectf(1,0,8,8,1,21)
draw.rrectf(1,-1,8,8,1,6) draw.rrectf(1,-1,8,8,1,6)

View File

@@ -30,7 +30,7 @@ function rooms.convert(src)
for rx=0,7 do for rx=0,7 do
for ty=0,11 do for ty=0,11 do
for tx=0,19 do for tx=0,19 do
surf.pixel(rx*20+tx, ry*13+ty, surf.pixel(rx*20+tx, ry*12+ty)) draw.pixel(rx*20+tx, ry*13+ty, draw.pixel(rx*20+tx, ry*12+ty))
end end
end end
end end
@@ -95,7 +95,7 @@ function rooms.draw()
-- Pintem el foreground de negre -- Pintem el foreground de negre
map.surf(rooms.surf_foreground) map.surf(rooms.surf_foreground)
pal.subpal(0,32,1) pal.subpal(1,32,1)
if rooms.is_visible(LAYER_FOREGROUND | LAYER_SHADOWS) then map.draw() end if rooms.is_visible(LAYER_FOREGROUND | LAYER_SHADOWS) then map.draw() end
-- Pintem els sprites de negre -- Pintem els sprites de negre
@@ -143,3 +143,8 @@ function rooms.toggle_visibility(layer)
rooms.visibility = rooms.visibility | layer rooms.visibility = rooms.visibility | layer
end end
end end
function rooms.go_to_room(room)
rooms.pos.x = (room % 8) * 20
rooms.pos.y = (room // 8) * 13
end

View File

@@ -6,8 +6,9 @@ score = {
font = nil font = nil
} local me = score } local me = score
function me.init() function me.init(reinit)
me.points = 0 if not reinit then me.points = 0 end
me.ypos = 3
me.surf = surf.load("gfx/sprites.gif") me.surf = surf.load("gfx/sprites.gif")
me.font = font.load("gfx/score_font.fnt") me.font = font.load("gfx/score_font.fnt")
end end
@@ -45,13 +46,16 @@ local function draw_key(sx,sy,dx,dy)
end end
function me.draw() function me.draw()
if sprites.hero.state == templates.DEAD then
if me.ypos > -100 then me.ypos=me.ypos-1 end
end
view.origin(0,0) view.origin(0,0)
surf.target(0) surf.target(0)
view.clip() surf.clip()
draw_text() draw_text()
local y = 3 local y = score.ypos
if sprites.hero.keys["verda"] then draw_key(16,48,140,y) y=y+8 end if sprites.hero.keys["verda"] then draw_key(16,48,140,y) y=y+8 end
if sprites.hero.keys["groga"] then draw_key(16,56,140,y) y=y+8 end if sprites.hero.keys["groga"] then draw_key(16,56,140,y) y=y+8 end
if sprites.hero.keys["roja"] then draw_key(32,48,140,y) y=y+8 end if sprites.hero.keys["roja"] then draw_key(32,48,140,y) y=y+8 end

View File

@@ -5,6 +5,9 @@ sprites = {
hero = nil, hero = nil,
list = {}, list = {},
pause_ia = false, pause_ia = false,
--initial_pos = { x=28, y=4*13*8+79 }
last_safe_room = 0 + 4 * 8,
last_safe_pos = { x=28, y=4*13*8+79 }
} }
function sprites.remove(sprite) function sprites.remove(sprite)
@@ -17,15 +20,15 @@ function sprites.remove(sprite)
end end
end end
function sprites.remove_out_of_room() function sprites.save_safe_pos()
--print("Current room: "..rooms.current()) local room = rooms.current()
--for i,v in ipairs(sprites.list) do --local hero_room = (sprites.hero.pos.x//160)*20 + ((sprites.hero.pos.y//104)*12) * 8
-- if v.room ~= rooms.current() then --if room ~= hero_room then return end
-- table.remove(sprites.list, i) if room == sprites.last_safe_room then return end
-- local room = v.room or 0
-- print("Sprite at room "..room.." removed: "..v.type) sprites.last_safe_room = room
-- end sprites.last_safe_pos = {x=sprites.hero.pos.x, y=sprites.hero.pos.y}
--end --print("safepos: " .. sprites.last_safe_pos.x .. ", " .. sprites.last_safe_pos.y)
end end
function sprites.add_from_room(rx,ry) function sprites.add_from_room(rx,ry)
@@ -63,6 +66,7 @@ function sprites.init()
light_ox = 8, light_ox = 8,
light_oy = 8, light_oy = 8,
cooldown = 0, cooldown = 0,
gun_cooldown = 0,
jump_throttle = 0, jump_throttle = 0,
lives = 4, lives = 4,
keys = {}, keys = {},
@@ -83,7 +87,9 @@ function sprites.set_animation(sprite, animation)
end end
function sprites.update() function sprites.update()
if not sys.beat() then return end --if not sys.beat() then return end
if sys.chrono() < 0.02 then return end
sys.chrono(0)
sprites.update_sprite(sprites.hero) sprites.update_sprite(sprites.hero)
for i,v in ipairs(sprites.list) do for i,v in ipairs(sprites.list) do
@@ -124,6 +130,9 @@ function sprites.lights_out()
spr.light = value spr.light = value
if finished then if finished then
spr.light = nil spr.light = nil
--if sprites.hero.state == templates.DEAD then
-- game.restart()
--end
end end
end end
) )
@@ -134,11 +143,32 @@ function sprites.lights_out()
sprites.hero.light = value sprites.hero.light = value
if finished then if finished then
sprites.hero.light = nil sprites.hero.light = nil
game.restart()
end end
end end
) )
end end
function sprites.lights_in()
for i,spr in ipairs(sprites.list) do
if spr.light then
tweening.add(0,spr.light,0.5,easing.linear,
function(value,n,finished)
spr.light = value
end
)
end
end
-- tweening.add(sprites.hero.light,0,0.5,easing.linear,
-- function(value,n,finished)
-- sprites.hero.light = value
-- if finished then
-- sprites.hero.light = nil
-- end
-- end
-- )
end
function sprites.draw(ignore_selected) function sprites.draw(ignore_selected)
if app.update ~= editor.update then if app.update ~= editor.update then
surf.target(game.circ_buf) surf.target(game.circ_buf)
@@ -201,7 +231,7 @@ function sprites.draw_sprite(sprite)
end end
function sprites.draw_sprite_selected(sprite) function sprites.draw_sprite_selected(sprite)
pal.subpal(0,32,28) pal.subpal(1,32,28)
local cycle = animations[sprite.animation].cycle[sprite.current_frame] local cycle = animations[sprite.animation].cycle[sprite.current_frame]
local frame = animations[sprite.animation].frames[cycle] local frame = animations[sprite.animation].frames[cycle]

View File

@@ -2,6 +2,8 @@ ia = {}
require "ia.*" require "ia.*"
local gota_wait = 1
templates = { templates = {
ALIVE = 0, ALIVE = 0,
DYING = 1, DYING = 1,
@@ -42,6 +44,23 @@ function me.create(type, options)
animation = "bullet", animation = "bullet",
ia = ia.update_bullet ia = ia.update_bullet
} }
elseif key == "bullet_particle" then
sprite = {
type = key,
pos = options.pos,--{ x=100, y=4*12*8+71 },
dir = options.dir,
size = { w=8,h=8 },
bbo = { left=2, top=3, right=3, bottom=1 },
current_frame = 1,
current_wait = 1,
flipped = options.flipped,
surf = surf.load("gfx/morcus.gif"),
animation = "particle",
state = me.ALIVE,
enemy = true,
room = options.room,
ia = ia.update_gota_esguit
}
elseif key == "coin" then elseif key == "coin" then
sprite = { sprite = {
type = key, type = key,
@@ -202,13 +221,15 @@ function me.create(type, options)
current_wait = 1, current_wait = 1,
flipped = options.flipped, flipped = options.flipped,
surf = surf.load("gfx/gota.gif"), surf = surf.load("gfx/gota.gif"),
animation = "gota_generador", animation = "gota",
state = me.ALIVE, state = me.ALIVE,
enemy = true, enemy = true,
timer = math.random(0,100), timer = gota_wait,
room = options.room, room = options.room,
ia = ia.update_gota ia = ia.update_gota
} }
gota_wait = gota_wait + 10
if gota_wait > 40 then gota_wait = 1 end
elseif key == "gota_caiguent" then elseif key == "gota_caiguent" then
sprite = { sprite = {
type = key, type = key,
@@ -242,6 +263,71 @@ function me.create(type, options)
room = options.room, room = options.room,
ia = ia.update_gota_esguit ia = ia.update_gota_esguit
} }
elseif key == "berserk" then
sprite = {
type = key,
pos = options.pos,--{ x=100, y=4*12*8+71 },
size = { w=16,h=16 },
bbo = { left=3, top=2, right=3, bottom=0 },
current_frame = 1,
current_wait = 1,
flipped = options.flipped,
surf = surf.load("gfx/berserk.gif"),
animation = "mummy_walk",
state = me.ALIVE,
enemy = true,
room = options.room,
ia = ia.update_berserk
}
elseif key == "abad" then
sprite = {
type = key,
pos = options.pos,--{ x=100, y=4*12*8+71 },
size = { w=16,h=18 },
bbo = { left=3, top=2, right=3, bottom=0 },
current_frame = 1,
current_wait = 1,
flipped = options.flipped,
surf = surf.load("gfx/abad.gif"),
animation = "abad",
state = me.ALIVE,
enemy = true,
room = options.room,
ia = ia.update_coin
}
elseif key == "dimoni" then
sprite = {
type = key,
pos = options.pos,--{ x=100, y=4*12*8+71 },
size = { w=16,h=17 },
bbo = { left=3, top=2, right=3, bottom=0 },
current_frame = 1,
current_wait = 1,
flipped = options.flipped,
surf = surf.load("gfx/dimoni.gif"),
animation = "dimoni_walk",
state = me.ALIVE,
enemy = true,
bulletproof = true,
room = options.room,
ia = ia.update_dimoni
}
elseif key == "ratpenat" then
sprite = {
type = key,
pos = options.pos,--{ x=100, y=4*12*8+71 },
size = { w=8,h=8 },
bbo = { left=1, top=1, right=1, bottom=1 },
current_frame = 1,
current_wait = 1,
flipped = options.flipped,
surf = surf.load("gfx/ratpenat.gif"),
animation = "ratpenat",
state = me.ALIVE,
enemy = true,
room = options.room,
ia = ia.update_ratpenat
}
else else
error("Template not recognized") error("Template not recognized")
end end

BIN
data/mus/paku_title.ogg Normal file

Binary file not shown.

BIN
data/snd/laugh.wav Normal file

Binary file not shown.

BIN
data/snd/thunder.wav Normal file

Binary file not shown.

View File

@@ -14,6 +14,8 @@ editor = {
item_dragged=nil, item_dragged=nil,
dragged_start_pos=nil, dragged_start_pos=nil,
flip=false, flip=false,
msg=nil,
msg_timeout=0,
enable = function() enable = function()
app.update = editor.update app.update = editor.update
@@ -41,7 +43,7 @@ editor = {
-- Pintar el mapa i sprites -- Pintar el mapa i sprites
rooms.draw() rooms.draw()
--view.origin(0,0)
local mx, my = mouse.pos() local mx, my = mouse.pos()
local tx, ty = (mx>>3), (my>>3) local tx, ty = (mx>>3), (my>>3)
mx, my = tx<<3, ty<<3 mx, my = tx<<3, ty<<3
@@ -130,19 +132,15 @@ editor = {
menu.toggle() menu.toggle()
elseif key.press(key.RIGHT) and rooms.pos.x < 20*7 then elseif key.press(key.RIGHT) and rooms.pos.x < 20*7 then
rooms.pos.x = rooms.pos.x + 20 rooms.pos.x = rooms.pos.x + 20
sprites.remove_out_of_room()
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
elseif key.press(key.LEFT) and rooms.pos.x > 0 then elseif key.press(key.LEFT) and rooms.pos.x > 0 then
rooms.pos.x = rooms.pos.x - 20 rooms.pos.x = rooms.pos.x - 20
sprites.remove_out_of_room()
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
elseif key.press(key.DOWN) and rooms.pos.y < 13*7 then elseif key.press(key.DOWN) and rooms.pos.y < 13*7 then
rooms.pos.y = rooms.pos.y + 13 rooms.pos.y = rooms.pos.y + 13
sprites.remove_out_of_room()
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
elseif key.press(key.UP) and rooms.pos.y > 0 then elseif key.press(key.UP) and rooms.pos.y > 0 then
rooms.pos.y = rooms.pos.y - 13 rooms.pos.y = rooms.pos.y - 13
sprites.remove_out_of_room()
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
elseif key.press(key.TAB) or key.press(key.ESCAPE) then elseif key.press(key.TAB) or key.press(key.ESCAPE) then
if editor.layer==LAYER_BACKGROUND or editor.layer==LAYER_FOREGROUND then if editor.layer==LAYER_BACKGROUND or editor.layer==LAYER_FOREGROUND then
@@ -157,6 +155,18 @@ editor = {
editor.play() editor.play()
elseif key.press(key.F11) then elseif key.press(key.F11) then
reload_textures() reload_textures()
elseif key.press(key.N1) then
editor.layer=LAYER_FOREGROUND
editor.msg="FOREGROUND"
editor.msg_timeout = 20
elseif key.press(key.N2) then
editor.layer=LAYER_BACKGROUND
editor.msg="BACKGROUND"
editor.msg_timeout = 20
elseif key.press(key.N3) then
editor.layer=LAYER_ITEMS
editor.msg="ITEMS"
editor.msg_timeout = 20
end end
if editor.layer==LAYER_ITEMS then if editor.layer==LAYER_ITEMS then
@@ -185,8 +195,11 @@ editor = {
draw.text(rooms.pos.x//20,1,96,28) draw.text(rooms.pos.x//20,1,96,28)
draw.text(rooms.pos.y//13,5,96,28) draw.text(rooms.pos.y//13,5,96,28)
-- Pintar el menú (el marcador serà en el modul game.lua) if editor.msg_timeout > 0 then
--score.draw() editor.msg_timeout = editor.msg_timeout - 1
draw.text(editor.msg, 10, 96, 8)
end
menu.draw() menu.draw()
end, end,
@@ -270,7 +283,7 @@ editor = {
surf.source(0) surf.source(0)
surf.target(editor.tilepicker.surf_back) surf.target(editor.tilepicker.surf_back)
view.origin(0,0) view.origin(0,0)
view.clip() surf.clip()
draw.surf(0,0,160,104,0,0) draw.surf(0,0,160,104,0,0)
app.push(editor.tilepicker.update_tiles) app.push(editor.tilepicker.update_tiles)
tweening.add(104,24,0.25,easing.easeOutCubic,function(value,n,finished)editor.tilepicker.pos_y=value end) tweening.add(104,24,0.25,easing.easeOutCubic,function(value,n,finished)editor.tilepicker.pos_y=value end)
@@ -284,7 +297,7 @@ editor = {
surf.source(editor.tilepicker.surf_back) surf.source(editor.tilepicker.surf_back)
surf.target(0) surf.target(0)
view.origin(0,0) view.origin(0,0)
view.clip() surf.clip()
draw.surf(0,0,160,104,0,0) draw.surf(0,0,160,104,0,0)
view.origin(8,editor.tilepicker.pos_y) view.origin(8,editor.tilepicker.pos_y)
@@ -340,7 +353,7 @@ editor = {
surf.source(0) surf.source(0)
surf.target(editor.itempicker.surf_back) surf.target(editor.itempicker.surf_back)
view.origin(0,0) view.origin(0,0)
view.clip() surf.clip()
draw.surf(0,0,160,104,0,0) draw.surf(0,0,160,104,0,0)
app.push(editor.itempicker.update_items) app.push(editor.itempicker.update_items)
tweening.add(104,24,0.25,easing.easeOutCubic,function(value,n,finished)editor.itempicker.pos_y=value end) tweening.add(104,24,0.25,easing.easeOutCubic,function(value,n,finished)editor.itempicker.pos_y=value end)
@@ -354,7 +367,7 @@ editor = {
surf.source(editor.itempicker.surf_back) surf.source(editor.itempicker.surf_back)
surf.target(0) surf.target(0)
view.origin(0,0) view.origin(0,0)
view.clip() surf.clip()
draw.surf(0,0,160,104,0,0) draw.surf(0,0,160,104,0,0)
view.origin(8,editor.itempicker.pos_y) view.origin(8,editor.itempicker.pos_y)
@@ -363,7 +376,7 @@ editor = {
draw.text("CHOOSE ITEM:",8,2,17) draw.text("CHOOSE ITEM:",8,2,17)
view.origin(16,editor.itempicker.pos_y+8-editor.itempicker.scroll) view.origin(16,editor.itempicker.pos_y+8-editor.itempicker.scroll)
view.clip(16,editor.itempicker.pos_y+8,128,64) surf.clip(16,editor.itempicker.pos_y+8,128,64)
surf.source(surf_sprites) surf.source(surf_sprites)
local mx, my = mouse.pos() local mx, my = mouse.pos()
@@ -391,7 +404,7 @@ editor = {
local lift_y = math.floor(((64-lift_h)*editor.itempicker.scroll)/(y-64)) local lift_y = math.floor(((64-lift_h)*editor.itempicker.scroll)/(y-64))
view.origin(16,editor.itempicker.pos_y+8) view.origin(16,editor.itempicker.pos_y+8)
view.clip() surf.clip()
draw.rrectf(124,0,5,64,1,17) draw.rrectf(124,0,5,64,1,17)
draw.rrectf(124,lift_y,5,lift_h,1,2) draw.rrectf(124,lift_y,5,lift_h,1,2)

View File

@@ -36,6 +36,17 @@ game = {
--shader.enable(); --shader.enable();
end, end,
restart = function()
--rooms.reload()
ia.hero_reset()
sprites.add_from_room(rooms.pos.x, rooms.pos.y)
pal.set(palfade.original)
sprites.hero.light = 0
tweening.add(0,100,1,easing.linear,function(value,n,finished)sprites.hero.light = value end)
sprites.lights_in()
score.init(true)
end,
update = function() update = function()
game.water_counter = game.water_counter + 0.05 game.water_counter = game.water_counter + 0.05
@@ -49,7 +60,7 @@ game = {
view.origin(0,0) view.origin(0,0)
surf.target(0) surf.target(0)
view.clip() surf.clip()
surf.target(game.back_buf) surf.target(game.back_buf)
@@ -62,13 +73,20 @@ game = {
score.draw() score.draw()
view.origin(0,0)
draw.text("safe: "..sprites.last_safe_room,1,96,28)
--draw.text(sprites.hero.pos.x ..","..sprites.hero.pos.y,14,89,28)
if key.press(key.ESCAPE) or key.press(key.F9) then if key.press(key.ESCAPE) or key.press(key.F9) then
rooms.reload() rooms.reload()
sprites.add_from_room(rooms.pos.x, rooms.pos.y) sprites.add_from_room(rooms.pos.x, rooms.pos.y)
ia.hero_reset()
editor.enable() editor.enable()
elseif key.press(key.GRAVE) then elseif key.press(key.GRAVE) then
console.enable() console.enable()
end end
draw.text(sys.fps(),2,20,8)
end, end,
change_room = function(x,y) change_room = function(x,y)
@@ -86,7 +104,7 @@ game = {
--if not sys.beat() then return end --if not sys.beat() then return end
view.origin(0,0) view.origin(0,0)
surf.target(0) surf.target(0)
view.clip() surf.clip()
surf.target(game.back_buf) surf.target(game.back_buf)
--view.clip() --view.clip()
@@ -106,7 +124,6 @@ game = {
game.chg_step = game.chg_step - 1 game.chg_step = game.chg_step - 1
if game.chg_step == 0 then if game.chg_step == 0 then
sprites.remove_out_of_room()
sprites.pause_ia = false sprites.pause_ia = false
app.pop() app.pop()
--sys.beat(2) --sys.beat(2)
@@ -130,9 +147,9 @@ game = {
surf.source(game.back_buf) surf.source(game.back_buf)
for x=0,159 do for x=0,159 do
local water_level = math.sin(game.water_counter)*2 local water_level = math.sin(game.water_counter)*2
for y=88+water_level,103 do for y=88+water_level,104 do
local pixel = surf.pixel(x,y) local pixel = draw.pixel(x,y)
surf.pixel(x,y,game.water_pal[pixel+1]) draw.pixel(x,y,game.water_pal[pixel+1])
end end
end end
end end
@@ -148,15 +165,15 @@ game = {
for y=0,103 do for y=0,103 do
for x=0,159 do for x=0,159 do
surf.source(game.back_buf) surf.source(game.back_buf)
local pixel = surf.pixel(x,y) local pixel = draw.pixel(x,y)
surf.source(game.circ_buf) surf.source(game.circ_buf)
local light = surf.pixel(x,y) local light = draw.pixel(x,y)
if light==0 then if light==0 then
surf.pixel(x,y,1) draw.pixel(x,y,1)
elseif (light&2)==2 then elseif (light&2)==2 then
surf.pixel(x,y,pixel) draw.pixel(x,y,pixel)
else else
surf.pixel(x,y,game.fade_pal[pixel+1]) draw.pixel(x,y,game.fade_pal[pixel+1])
end end
end end
end end

107
data/stages/titles.lua Normal file
View File

@@ -0,0 +1,107 @@
titles = {
pharao = nil,
jailgames = nil,
jgmummy = nil,
}
local sndLaugh, sndThunder
local musTitles
function titles.lightning_step1()
pal.subpal(29,1)
pal.subpal(4,1)
pal.subpal(6,1)
pal.subpal(4,1)
pal.subpal(21,28)
pal.subpal(22,28)
pal.subpal(26,28)
surf.source(titles.pharao)
draw.surf(0,0,160,104,0,0)
pal.subpal()
surf.source(titles.jailgames)
draw.surf(0,0,98,14,31,49)
end
function titles.lightning_step2()
pal.subpal(29,28)
pal.subpal(4,28)
pal.subpal(6,28)
pal.subpal(4,28)
pal.subpal(1,28)
pal.subpal(21,1)
pal.subpal(22,1)
pal.subpal(26,1)
pal.subpal(28,1)
surf.source(titles.pharao)
draw.surf(0,0,160,104,0,0)
surf.source(titles.jailgames)
draw.surf(0,0,98,14,31,49)
pal.subpal()
end
local dt = 0
function titles.enable()
app.update = titles.update
titles.pharao = surf.load("gfx/titles/pharao.gif")
titles.jailgames = surf.load("gfx/titles/jailgames.gif")
titles.jgmummy = surf.load("gfx/titles/jgmummy.gif")
surf.target(surf.SCREEN)
sndLaugh = sound.load("snd/laugh.wav")
sndThunder = sound.load("snd/thunder.wav")
music.play("mus/paku_title.ogg", 0)
dt = sys.time()
end
function titles.update()
surf.source(titles.jailgames)
draw.surf(0,0,98,14,31,49)
if sys.time()-dt > 4 then
app.update = titles.step2
dt = sys.time()
sound.play(sndThunder)
sound.play(sndLaugh)
end
end
function titles.step2()
titles.lightning_step1()
if sys.time()-dt > 0.1 then
app.update = titles.step3
dt = sys.time()
end
end
function titles.step3()
surf.cls(28)
if sys.time()-dt > 0.1 then
app.update = titles.step4
dt = sys.time()
end
end
function titles.step4()
titles.lightning_step2()
if sys.time()-dt > 0.1 then
app.update = titles.step5
dt = sys.time()
end
end
function titles.step5()
surf.cls(28)
if sys.time()-dt > 0.1 then
app.update = titles.step6
dt = sys.time()
end
end
function titles.step6()
surf.source(titles.pharao)
draw.surf(0,0,160,104,0,0)
surf.source(titles.jgmummy)
draw.surf(0,0,112,22,24,45)
--titles.lightning_step1()
--app.update = titles.step7
end

View File

@@ -30,7 +30,7 @@ end
function me.update() function me.update()
local top = (160-me.w)//2 local top = (160-me.w)//2
local left = (104-me.h)//2 local left = (104-me.h)//2
view.clip(top, left, me.w, me.h) surf.clip(top, left, me.w, me.h)
view.origin(top, left) view.origin(top, left)
draw.rrectf(0,0,me.w, me.h,4,27) draw.rrectf(0,0,me.w, me.h,4,27)

BIN
drafts/cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 KiB

BIN
drafts/full_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

35
paku.pal Normal file
View File

@@ -0,0 +1,35 @@
JASC-PAL
0100
32
0 0 0
0 0 0
96 57 19
79 43 36
42 35 73
125 56 64
50 83 95
115 99 87
255 0 0
130 91 49
138 101 59
162 125 81
193 108 91
123 178 78
251 205 26
153 134 117
152 135 119
197 145 84
205 158 112
232 153 115
240 189 119
65 128 160
116 173 187
190 187 178
199 176 158
251 223 155
198 194 195
255 249 228
254 255 255
28 23 48
33 10 13
26 26 17