From d2ebbccbf64c3f12918d559ea70ac35e3f788d8e Mon Sep 17 00:00:00 2001 From: "Raimon @ quifisraimon" Date: Tue, 6 Oct 2026 15:56:37 +0200 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20El=20mono=20-=20[NEW]=20Noves=20ani?= =?UTF-8?q?macions=20de=20detallets=20-=20[NEW]=20M=C3=A9s=20particles=20i?= =?UTF-8?q?=20eye=20candy=20-=20[FIX]=20Si=20es=20ficava=20un=20item/enemi?= =?UTF-8?q?c=20en=20la=20fila=20de=20baix=20del=20tot=20no=20es=20guardaba?= =?UTF-8?q?=20-=20[FIX]=20Quan=20se=20disaparaba=20cap=20a=20la=20dreta=20?= =?UTF-8?q?amb=20el=20final=20de=20la=20pantalla=20o=20una=20pared=20en=20?= =?UTF-8?q?la=20esquena,=20la=20bala=20no=20eixia=20-=20[WIP]=20Treballant?= =?UTF-8?q?=20en=20el=20marcador?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/gfx/mono.gif | Bin 0 -> 338 bytes data/gfx/morcus.gif | Bin 841 -> 841 bytes data/gfx/sprites.gif | Bin 3192 -> 3292 bytes data/maps/rooms_background.gif | Bin 3528 -> 3528 bytes data/maps/rooms_foreground.gif | Bin 4846 -> 4846 bytes data/maps/rooms_items.gif | Bin 1475 -> 1483 bytes data/modules/animations.lua | 23 +++++++++++++++--- data/modules/ia/berserk.lua | 3 +++ data/modules/ia/bullet.lua | 6 +++++ data/modules/ia/dimoni.lua | 3 +++ data/modules/ia/gota.lua | 3 +++ data/modules/ia/hero.lua | 39 +++++++++++++++++++++++++----- data/modules/ia/mummy.lua | 3 +++ data/modules/ia/nothing.lua | 4 +++ data/modules/ia/porta.lua | 6 +++++ data/modules/items.lua | 2 ++ data/modules/score.lua | 43 ++++++++++++++++++++------------- data/modules/sprites.lua | 14 ++++++++++- data/modules/templates.lua | 37 ++++++++++++++++++++++++++++ data/utils/palfade.lua | 13 ++++++++++ 20 files changed, 172 insertions(+), 27 deletions(-) create mode 100644 data/gfx/mono.gif create mode 100644 data/modules/ia/nothing.lua diff --git a/data/gfx/mono.gif b/data/gfx/mono.gif new file mode 100644 index 0000000000000000000000000000000000000000..d700cb215449766394fe7ffd9cda5e42a3233f5c GIT binary patch literal 338 zcmV-Y0j>T=Nk%v~VK4v?0K@Rx|FvZJ1%|*JL%&$PxtkBlJ)Y`?h k;EW}!;i%=vw2!pb(VXf^>*?6+RWI;fFY);H=tdy`J64gD9RL6T literal 0 HcmV?d00001 diff --git a/data/gfx/morcus.gif b/data/gfx/morcus.gif index afb6b7d3dcf0cc115ca8b6c85cf759a2b14b818b..2a15b8aab66cc18c0f9df6a331ed4f2fe7f9f713 100644 GIT binary patch delta 704 zcmV;x0zdu92FV7Hm4B0Ti@UW{00O}nA-Px2x4aRJ7^LrcOzMWk>TZXHN>^R&%i&0t zh}o)D6ppS*RQC;=c3aPJyA5AQ=H53-Xi$1=bcB9NaDJ5iY?^4XXf>;>U$v-Gc$|qdvcHl}zkjhMqNA_E!$dK3%E5mm zWDX1y91IK`cgnMt+r5*(rqa~b*vHXiC1p(?4N28291_}idyz-Bn#9{}|0jXH;8UuU~Ee-^9BAQ2fDDVFX;W%*Q!-y_P zOpr#?fl8D1Qh%!a!Dd>{lmRBjTX|Ba8K2aQg6S6ksm_}{ivlJ36Q!A%HOWBrC)H{@ zcVLfprDtL&)udCSRwWCjEQzA_#EsqBbnYF9HSd{%OU=Z90S5w03cy#dUKd0}Kmf4# zZO*tilJdNwVZj0g926`dS@;d%$9->9woE#}RyLzCYk$_@H5h8ksu!>p$|4qHFsUX}BCTYp?k$lYlr2yhL48YnQ>ey}Zv;D3fFpyG<2$#-Ca88Tp5gD~0;ANVdu516JN(q?>d$DZ`U>&N(qBo@$ox=bK^fIjATv9IECFNH*Fi moTUhQK%YWb`KVc7I9jEiduYlhr0MPdN^Ed1Oxfc-`QY5&L-$p^)pi!GZvgDnN9v%NGl-Tgjgl8}v zOgKp`T1k>9et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ary patch delta 16 XcmaE-`c8EN7c;YhbJu2G=7;|QQ0bK&022}fSb+#pq#=S)VW<^%99~r2hXO$u z;)w#immi2dUGR~L4Q-g8g5zy=U_|TPXpm+WruY#CCR%F<#2XPsqu3?QjYml-=N|2wp2K8%4ch!oQ zug4}|QTxAD#X9dcEjhXO&k z;fWQZ2*8Jaz2}gI`6)QwW(P*JUX2E6mLhm6_UNN^GG0WXUpN`mUrQtAG^9tDxwzK= z3PEYol9eTSk%>Q&7bIL44L}J1QZ{6zL4BR{9E(LQ;MAB|LKGrH%C#vcO9jS%#O9ne z-FeWKcrj;?o^%@a=8ieC^d63QCaNfvNGeGXb_=}~=UR_e%9x@q9r@6pnDWFa09FF3 z6Lh396y`t&L?mjb0BFjpLrxN?G^t;!9)#tIw}$oUt17zMC_#GG8WgV`-4*LzyAo@d zu*%xRELWN)yP!kQq9|=wr#Aa{)U|=F8mFFb6^N#F<8sCAZQ9CIu9;g^dyq!y;u 0 then anim = "hero_jump" @@ -156,9 +160,11 @@ function ia.update_hero() return end sprites.hero.pos.y = sprites.hero.pos.y + 2 + sprites.hero.falling = true end else -- SI NO ESTÀ CAIGUENT... + on_the_floor = true if tile_under_me1==84 then map.tile(tx1,ty+2,68) local broken_tile = templates.create("brick", {pos={x=sprites.tile_to_pixel(tx1), y=sprites.tile_to_pixel(ty+2)}, flipped=sprites.hero.flipped}) @@ -169,7 +175,7 @@ function ia.update_hero() local broken_tile = templates.create("brick", {pos={x=sprites.tile_to_pixel(tx2), y=sprites.tile_to_pixel(ty+2)}, flipped=sprites.hero.flipped}) table.insert(sprites.list, broken_tile) end - if tile_under_me1>=16 or tile_under_me1>=16 then + if tile_under_me1>=16 or tile_under_me2>=16 then sprites.hero.pos.y = sprites.tile_to_pixel(ty)-1 end anim = "hero_stand" @@ -188,16 +194,19 @@ function ia.update_hero() -- SI POLSA BOTAR... if ( key.down(key.X) or pad.down(pad.A) ) and sprites.hero.jump_throttle == 0 then sprites.hero.jumping = 17 - table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+6, y=sprites.hero.pos.y+16}, dir={x=-0.7,y=-0.3}, flipped=sprites.hero.flipped})) - table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+8, y=sprites.hero.pos.y+15}, dir={x=-0.5,y=-0.1}, flipped=sprites.hero.flipped})) - table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.7,y=-0.3}, flipped=sprites.hero.flipped})) - table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+12, y=sprites.hero.pos.y+15}, dir={x=0.5,y=-0.1}, flipped=sprites.hero.flipped})) + sprites.dust(sprites.hero) + ---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+6, y=sprites.hero.pos.y+16}, dir={x=-0.9,y=-0.5}, flipped=sprites.hero.flipped})) + ---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+8, y=sprites.hero.pos.y+17}, dir={x=-0.5,y=-0.7}, flipped=sprites.hero.flipped})) + ---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.9,y=-0.5}, flipped=sprites.hero.flipped})) + ---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+12, y=sprites.hero.pos.y+17}, dir={x=0.5,y=-0.7}, flipped=sprites.hero.flipped})) -- SI POLSA DISPAR... elseif (sprites.hero.gun_cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then sprites.hero.shooting = true 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 start_x = sprites.hero.pos.x + if not sprites.hero.flipped then start_x = start_x + 16 end + local bullet = templates.create("bullet", {pos={x=start_x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped}) table.insert(sprites.list, bullet) anim = "hero_shoot" end @@ -206,9 +215,15 @@ function ia.update_hero() end -- ESTIGA COM ESTIGA, SI POLSA ESQUERRA O DRETA... if not sprites.hero.shooting and not sprites.hero.has_been_hit then + local was_flipped = sprites.hero.flipped + local was_standing = sprites.hero.animation == "hero_stand" if key.down(key.LEFT) or pad.down(pad.LEFT) then sprites.hero.flipped = true + if on_the_floor and (was_standing or not was_flipped) then sprites.dust(sprites.hero) end anim = move_anim + --if on_the_floor and sprites.hero.current_wait == 1 and (sprites.hero.current_frame == 1 or sprites.hero.current_frame == 3) then + -- table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.1,y=-0.7}, flipped=sprites.hero.flipped})) + --end local tx, ty = sprites.get_tile(sprites.hero.pos.x+3), sprites.get_tile(sprites.hero.pos.y+16) if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then if txrooms.pos.x+19 then @@ -230,6 +249,14 @@ function ia.update_hero() end end end + + if (was_falling and not sprites.hero.falling) then + sprites.hero.flipped = not sprites.hero.flipped + sprites.dust(sprites.hero) + sprites.hero.flipped = not sprites.hero.flipped + sprites.dust(sprites.hero) + end + sprites.set_animation(sprites.hero, anim) end diff --git a/data/modules/ia/mummy.lua b/data/modules/ia/mummy.lua index c7d39e0..11895ff 100644 --- a/data/modules/ia/mummy.lua +++ b/data/modules/ia/mummy.lua @@ -9,6 +9,7 @@ function ia.update_mummy(spr) if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then sprites.hero.hit() spr.flipped = not spr.flipped + sprites.dust(spr) end end @@ -18,6 +19,7 @@ function ia.update_mummy(spr) spr.pos.x = spr.pos.x - 1 else spr.flipped = not spr.flipped + sprites.dust(spr) end else local tx, ty = sprites.get_tile(spr.pos.x+12), sprites.get_tile(spr.pos.y+15) @@ -25,6 +27,7 @@ function ia.update_mummy(spr) spr.pos.x = spr.pos.x + 1 else spr.flipped = not spr.flipped + sprites.dust(spr) end end elseif spr.state == templates.DYING then diff --git a/data/modules/ia/nothing.lua b/data/modules/ia/nothing.lua new file mode 100644 index 0000000..657e236 --- /dev/null +++ b/data/modules/ia/nothing.lua @@ -0,0 +1,4 @@ + +function ia.do_nothing(spr) + -- este actor no fa res +end diff --git a/data/modules/ia/porta.lua b/data/modules/ia/porta.lua index 15b02d3..cd8aac7 100644 --- a/data/modules/ia/porta.lua +++ b/data/modules/ia/porta.lua @@ -8,9 +8,15 @@ function ia.update_porta(spr) sprites.hero.keys[spr.color] = nil sprites.set_animation(spr, "porta_obrint") spr.state = templates.DYING + spr.last_frame=0 end end elseif spr.state == templates.DYING then + if spr.current_frame ~= spr.last_frame then + spr.last_frame = spr.current_frame + sprites.dust_ex(spr, {pos={x=spr.pos.x+1, y=spr.pos.y+16-spr.last_frame}, dir={x=math.random()-0.5,y=0.9}, flipped=spr.flipped}) + end + if spr.current_frame == 15 then local tx, ty = sprites.get_tile(spr.pos.x), sprites.get_tile(spr.pos.y) map.surf(rooms.surf_items) diff --git a/data/modules/items.lua b/data/modules/items.lua index 512ac3c..19d4b0e 100644 --- a/data/modules/items.lua +++ b/data/modules/items.lua @@ -21,4 +21,6 @@ items = { { 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} }, + { name="mono", label="mono", visual={x=0, y=80, w=16, h=16} }, + { name="llum", label="llum", visual={x=89, y=48, w=7, h=7} }, } diff --git a/data/modules/score.lua b/data/modules/score.lua index fe76619..ced7754 100644 --- a/data/modules/score.lua +++ b/data/modules/score.lua @@ -1,6 +1,6 @@ score = { points = 0, - color = 28, + color = 27, ypos = 3, surf = nil, font = nil @@ -14,21 +14,24 @@ function me.init(reinit) end local function draw_text() - font.current(me.font) - font.spacing(0) local txt = string.format("%03d", me.points) --- draw.text(txt,2,me.ypos-1,27) --- draw.text(txt,3,me.ypos-1,27) --- draw.text(txt,4,me.ypos-1,27) --- draw.text(txt,2,me.ypos,27) --- draw.text(txt,4,me.ypos,27) --- draw.text(txt,2,me.ypos+1,27) --- draw.text(txt,4,me.ypos+1,27) --- draw.text(txt,2,me.ypos+2,27) --- draw.text(txt,3,me.ypos+2,27) --- draw.text(txt,4,me.ypos+2,27) - draw.text(txt,3,me.ypos+1,1) - draw.text(txt,3,me.ypos,me.color) + draw.text(txt,10,me.ypos,me.color) + +-- font.current(me.font) +-- font.spacing(0) +-- draw.text(txt,2,me.ypos+2,1) +-- draw.text(txt,3,me.ypos+2,1) +-- draw.text(txt,4,me.ypos+2,1) +-- draw.text(txt,2,me.ypos-1,26) +-- draw.text(txt,3,me.ypos-1,26) +-- draw.text(txt,4,me.ypos-1,26) +-- draw.text(txt,2,me.ypos,26) +-- draw.text(txt,4,me.ypos,26) +-- draw.text(txt,2,me.ypos+1,26) +-- draw.text(txt,4,me.ypos+1,26) +---- draw.text(txt,3,me.ypos+1,1) +-- draw.text(txt,3,me.ypos,me.color) + font.current(font.DEFAULT) font.spacing(1) surf.source(me.surf) @@ -46,24 +49,30 @@ local function draw_key(sx,sy,dx,dy) end function me.draw() + local paleta = palfade.get() + palfade.restore() + if sprites.hero.state == templates.DEAD then if me.ypos > -100 then me.ypos=me.ypos-1 end end view.origin(0,0) surf.target(0) surf.clip() - + draw_text() + draw.surf(0,40,8,8, 1,1) local y = score.ypos 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["roja"] then draw_key(32,48,140,y) y=y+8 end if sprites.hero.keys["blava"] then draw_key(32,56,140,y) y=y+8 end + + palfade.set(paleta) end function me.inc(value) me.points = me.points + value - tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) me.color = (math.floor(val)&1) == 0 and 28 or 14 end) + tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) me.color = (math.floor(val)&1) == 0 and 27 or 14 end) tweening.add(5, 3, 0.5, easing.easeOutElastic, function(val,progress,finished) me.ypos = math.floor(val) end) end diff --git a/data/modules/sprites.lua b/data/modules/sprites.lua index 0f62007..730619c 100644 --- a/data/modules/sprites.lua +++ b/data/modules/sprites.lua @@ -43,7 +43,7 @@ end function sprites.add_from_room(rx,ry) sprites.list = {} map.surf(rooms.surf_items) - for y = ry, ry+11 do + for y = ry, ry+12 do for x = rx, rx+19 do if map.tile(x,y) ~= 0 then local room = (rx//20) + (ry//12) * 8 @@ -260,3 +260,15 @@ function sprites.draw_sprite_selected(sprite) draw.mode(draw.NORMAL) draw.surf(sx, sy, w, h, x, y, w, h, f) end + +function sprites.dust(spr) + if spr.flipped then + table.insert(sprites.list, templates.create("polseta", {pos={x=spr.pos.x+10, y=spr.pos.y+16}, dir={x=-0.1,y=-0.7}, flipped=not spr.flipped})) + else + table.insert(sprites.list, templates.create("polseta", {pos={x=spr.pos.x+4, y=spr.pos.y+16}, dir={x=-0.1,y=-0.7}, flipped=not spr.flipped})) + end +end + +function sprites.dust_ex(spr, options) + table.insert(sprites.list, templates.create("polseta", options)) +end diff --git a/data/modules/templates.lua b/data/modules/templates.lua index 3eb7f77..0850e78 100644 --- a/data/modules/templates.lua +++ b/data/modules/templates.lua @@ -345,6 +345,43 @@ function me.create(type, options) room = options.room, ia = ia.update_polseta } + elseif key == "mono" then + sprite = { + type = key, + pos = options.pos,--{ x=100, y=4*12*8+71 }, + size = { w=16,h=16 }, + bbo = { left=0, top=0, right=0, bottom=0 }, + current_frame = 1, + current_wait = 1, + flipped = options.flipped, + surf = surf.load("gfx/mono.gif"), + animation = "mono_wait", + state = me.ALIVE, + enemy = true, + bulletproof = true, + room = options.room, + ia = ia.do_nothing + } + elseif key == "llum" then + sprite = { + type = key, + pos = options.pos,--{ x=100, y=4*12*8+71 }, + size = { w=7,h=7 }, + bbo = { left=0, top=0, right=0, bottom=0 }, + current_frame = 1, + current_wait = 1, + flipped = options.flipped, + surf = surf.load("gfx/sprites.gif"), + animation = "invisible", + state = me.ALIVE, + enemy = true, + bulletproof = true, + room = options.room, + light = 40, + light_ox = 4, + light_oy = 4, + ia = ia.do_nothing + } else error("Template not recognized") end diff --git a/data/utils/palfade.lua b/data/utils/palfade.lua index bcf8652..5c7602d 100644 --- a/data/utils/palfade.lua +++ b/data/utils/palfade.lua @@ -59,3 +59,16 @@ end function me.restore() pal.set(me.original) end + +function me.get() + paleta = {} + for i=1,32 do + paleta[i] = {} + paleta[i].r, paleta[i].g, paleta[i].b = pal.color(i-1) + end + return paleta +end + +function me.set(paleta) + pal.set(paleta) +end