[NEW] Veu de l'imp

[NEW] Afegits cacaus desapareguts en la intro
This commit is contained in:
2026-04-04 12:55:33 +02:00
parent 42b4638567
commit e4fe812e4a
10 changed files with 195 additions and 6 deletions

View File

@@ -356,7 +356,7 @@ function abad_state_fire()
end end
end end
if abad.save_update~=nil then abad_advance() end if abad.save_update~=nil and abad.save_update~=abad_state_normal then abad_advance() end
end end
function abad_state_walking() function abad_state_walking()

View File

@@ -19,3 +19,4 @@ audio_text_abad="snd_txta.wav"
audio_text_premiere="snd_txtp.wav" audio_text_premiere="snd_txtp.wav"
audio_text_elalien="snd_txte.wav" audio_text_elalien="snd_txte.wav"
audio_text_batman="snd_txtb.wav" audio_text_batman="snd_txtb.wav"
audio_text_imp="snd_txtb.wav"

52
data/fireball.lua Normal file
View File

@@ -0,0 +1,52 @@
local arcade_config = require("arcade_config")
o2aX = arcade_config.org2arc_escala
fireball={hab=-1,x=0,y=0,wait=0,flip=false,bb={x=0,y=0,w=4,h=4}}
function fireball.init(_hab,_x,_y,_flip)
if fireball.hab ~= -1 then return end
fireball.hab=_hab
fireball.x=_x
fireball.y=_y
fireball.flip=_flip
end
function fireball.draw()
draw.circf(fireball.x*o2aX,fireball.y*o2aX,3*o2aX,16)
draw.circf(fireball.x*o2aX,fireball.y*o2aX,2*o2aX,3)
draw.circf(fireball.x*o2aX,fireball.y*o2aX,1*o2aX,8)
end
function fireball.update()
if fireball.hab == -1 then return end
fireball.wait=fireball.wait+1
if fireball.wait==3 then
fireball.wait=0
if fireball.x>96 then
fireball.hab=-1
return
elseif check_tile(fireball.hab,fireball.x,fireball.y)<tiletype.block then
if fireball.flip then
fireball.x=fireball.x-4
else
fireball.x=fireball.x+4
end
if fireball.x<-4 then
fireball.hab=-1
return
end
else
fireball.hab=-1
return
end
if fireball.hab==abad.hab then
if aabb(fireball,abad) and abad.update~=abad_state_crouch then
fireball.hab=-1
abad_hurt(1)
end
end
end
end

View File

@@ -14,6 +14,7 @@ require "zombie"
require "score" require "score"
require "switches" require "switches"
require "trigger" require "trigger"
require "imp"
local tile_w = arcade_config.tiles_width local tile_w = arcade_config.tiles_width
local tile_h = arcade_config.tiles_height local tile_h = arcade_config.tiles_height
@@ -113,6 +114,9 @@ function game_init(menu)
elalien.init() elalien.init()
table.insert(actors,elalien) table.insert(actors,elalien)
imp.init()
table.insert(actors,imp)
--batman --batman
bol.init() bol.init()

125
data/imp.lua Normal file
View File

@@ -0,0 +1,125 @@
local arcade_config = require("arcade_config")
o2aX = arcade_config.org2arc_escala
cxr = arcade_config.character_per_row-1
cxr2 = arcade_config.character_per_row_base2
cw = arcade_config.character_width
ch = arcade_config.character_height
-- 4, 3
imp={hab=75,
x=24,
y=24,
w=32,
h=32,
flip=true,
enabled=false,
counter=500,
frame=28,
wait=0,
step=0,
anim={28,29,28,30},
bb={x=4,y=0,w=16,h=32},
scene_intro=false,
scene_object=false}
function imp.reset()
imp.hit=imp.hit
imp.update=imp.update
imp.draw=imp.draw
imp.hab=abad.hab
imp.enabled=false
imp.counter=500
end
function imp.init()
-- imp.enabled=false
-- imp.hit=imp.hit
-- imp.update=imp.update
-- imp.draw=imp.draw
-- imp.hab=abad.hab
-- if abad.x<40 then
-- if check_tile(imp.hab,92,38)<tiletype.half and
-- check_tile(imp.hab,84,38)<tiletype.half and
-- check_tile(imp.hab,92,30)<tiletype.half and
-- check_tile(imp.hab,84,30)<tiletype.half and
-- check_tile(imp.hab,92,46)>=tiletype.half then
-- imp.enabled=true
-- imp.flip=true
-- imp.x=92
-- else
-- imp.reset()
-- end
-- else
-- if check_tile(imp.hab,0,38)<tiletype.half and
-- check_tile(imp.hab,8,38)<tiletype.half and
-- check_tile(imp.hab,0,30)<tiletype.half and
-- check_tile(imp.hab,0,30)<tiletype.half and
-- check_tile(imp.hab,0,46)>=tiletype.half then
-- imp.enabled=true
-- imp.flip=false
-- imp.x=-12
-- else
-- imp.reset()
-- end
-- end
imp.hab=55
local world_x, world_y = coords.room_to_world(55,4,3)
imp.x=world_x
imp.y=world_y
imp.flip = true
end
function imp.draw()
-- if imp.enabled then
-- -- draw.surf((imp.frame&7)*16,(imp.frame>>3)*16,16,16,imp.x,imp.y,16,16,imp.flip)
-- draw.surf((imp.frame&7)*cw,(imp.frame>>cxr2)*ch,cw,ch,imp.x*o2aX,imp.y*o2aX,cw,ch,imp.flip)
-- end
local scr_x, scr_y = viewp:screen_coords( imp.x, imp.y )
draw.surf((imp.frame&7)*imp.w, (imp.frame>>cxr2)*imp.h, imp.w, imp.h, scr_x, scr_y, imp.w, imp.h, imp.flip)
end
function imp.hit()
end
function imp.update()
-- imp.wait=imp.wait+1
--
-- if imp.wait==6 then
-- imp.wait=0
-- if not imp.enabled then
-- imp.counter=imp.counter-1
-- local r = math.random(0,imp.counter-1)
-- --print(r)
-- if imp.counter==1 or r==1 then
-- imp.init()
-- end
-- return
-- end
--
-- imp.step=(imp.step+1)%4
-- imp.frame=imp.anim[imp.step+1]
--
-- if imp.flip then
-- imp.x=imp.x-2
-- if imp.x==78 then
-- fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
-- sound.play(audio_hit)
-- imp.flip=not imp.flip
-- elseif imp.x==-12 then
-- imp.reset()
-- end
-- else
-- imp.x=imp.x+2
-- if imp.x==4 then
-- fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
-- sound.play(audio_hit)
-- imp.flip=not imp.flip
-- elseif imp.x==92 then
-- imp.reset()
-- end
-- end
--
-- end
end

View File

@@ -1,6 +1,7 @@
local abad={x=0,y=0,w=32,h=32,dx=88,dy=48,dw=32,dh=32} local abad={x=0,y=0,w=32,h=32,dx=88,dy=48,dw=32,dh=32}
local batman={x=0,y=96,w=32,h=32,dx=164,dy=48,dw=32,dh=32} local batman={x=0,y=96,w=32,h=32,dx=164,dy=48,dw=32,dh=32}
local cacaus={x=224,y=176,w=32,h=16,dx=152,dy=64,dw=32,dh=16} local cacaus={x=224,y=176,w=32,h=16,dx=152,dy=64,dw=32,dh=16}
local cacaus_trans={x=192,y=176,w=16,h=8,dx=65,dy=56,dw=16,dh=8}
local marc={x=30,y=6,w=198,h=102,color=2} local marc={x=30,y=6,w=198,h=102,color=2}
local pas_porta={x=146,y=48,w=14,h=32,color=16} local pas_porta={x=146,y=48,w=14,h=32,color=16}
local scene_x_offset = 32 local scene_x_offset = 32
@@ -25,6 +26,8 @@ function draw_item_intro( name, flip )
draw.surf(batman.x, batman.y, batman.w, batman.h, batman.dx, batman.dy, batman.dw, batman.dh, flip) draw.surf(batman.x, batman.y, batman.w, batman.h, batman.dx, batman.dy, batman.dw, batman.dh, flip)
elseif (name == "cacaus" ) then elseif (name == "cacaus" ) then
draw.surf(cacaus.x, cacaus.y, cacaus.w, cacaus.h, cacaus.dx, cacaus.dy, cacaus.dw, cacaus.dh, flip) draw.surf(cacaus.x, cacaus.y, cacaus.w, cacaus.h, cacaus.dx, cacaus.dy, cacaus.dw, cacaus.dh, flip)
elseif (name == "cacaus trans" ) then
draw.surf(cacaus_trans.x, cacaus_trans.y, cacaus_trans.w, cacaus_trans.h, cacaus_trans.dx, cacaus_trans.dy, cacaus_trans.dw, cacaus_trans.dh, flip)
elseif (name == "marc" ) then elseif (name == "marc" ) then
draw.rect(marc.x, marc.y, marc.w, marc.h, marc.color) draw.rect(marc.x, marc.y, marc.w, marc.h, marc.color)
elseif (name == "pas porta" ) then elseif (name == "pas porta" ) then
@@ -82,7 +85,8 @@ function intro_update()
-- STEP 2 -- STEP 2
elseif intro_step==2 then elseif intro_step==2 then
draw_escenari() draw_escenari()
draw_item_intro("abad", false) draw_item_intro("abad", true)
draw_item_intro("cacaus trans", false)
view.origin(0,0) view.origin(0,0)
intro_step=intro_step+1 intro_step=intro_step+1
-- STEP 3 -- STEP 3

View File

@@ -61,6 +61,7 @@ function audio_init()
audio_text_premiere = sound.load(audio_text_premiere) audio_text_premiere = sound.load(audio_text_premiere)
audio_text_elalien = sound.load(audio_text_elalien) audio_text_elalien = sound.load(audio_text_elalien)
audio_text_batman = sound.load(audio_text_batman) audio_text_batman = sound.load(audio_text_batman)
audio_text_imp = sound.load(audio_text_imp)
audio_abad_jump = sound.load(audio_abad_jump) audio_abad_jump = sound.load(audio_abad_jump)
audio_abad_fall = sound.load(audio_abad_fall) audio_abad_fall = sound.load(audio_abad_fall)
audio_abad_hit = sound.load(audio_abad_hit) audio_abad_hit = sound.load(audio_abad_hit)
@@ -86,7 +87,7 @@ function mini.init()
surf.target(0) surf.target(0)
surf.cls(16) surf.cls(16)
flow:executar("game") flow:executar("intro")
end end
function mini.update() function mini.update()

View File

@@ -21,11 +21,11 @@ avatar_imp_y = 96
scenes={ scenes={
lluita_imp= { lluita_imp= {
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eh!?","...","Tu qui eres?"},die=20}, {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eh!?","...","Tu qui eres?"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","Aaaarrrrgghhh",""},die=20,musica=audio_song_imp}, {x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Aaaarrrrgghhh",""},die=20,musica=audio_song_imp},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Who are you?","Comment tu t'appel?","Quod nomen tibi est?"},die=20}, {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Who are you?","Comment tu t'appel?","Quod nomen tibi est?"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","Grwuuuunnnn",""},die=20}, {x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","Grwuuuunnnn",""},die=20},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eeeerrrrggggg","Prruuuuuuummm","Uooooorrrr"},die=20}, {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eeeerrrrggggg","Prruuuuuuummm","Uooooorrrr"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","GROOOOAAAARRR",""},die=20}, {x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="imp",text={"","GROOOOAAAARRR",""},die=20},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"MERDA!!","S'HA ENFADAT!!!","CACAUS A MI!!!!"},die=20}, {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"MERDA!!","S'HA ENFADAT!!!","CACAUS A MI!!!!"},die=20},
}, },
llibre_trobat={ llibre_trobat={
@@ -193,6 +193,8 @@ function playtext(snd)
sound.play(audio_text_premiere) sound.play(audio_text_premiere)
elseif snd=="elalien" then elseif snd=="elalien" then
sound.play(audio_text_elalien) sound.play(audio_text_elalien)
elseif snd=="imp" then
sound.play(audio_text_imp)
end end
end end

BIN
data/snd_txti.wav Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB