Escenes funcionant.
Altres correccions menors.
This commit is contained in:
119
data/intro.lua
119
data/intro.lua
@@ -1,73 +1,55 @@
|
||||
o2aX = arcade_config.org2arc_escala
|
||||
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 cacaus={x=224,y=176,w=32,h=16,dx=152,dy=64,dw=32,dh=16}
|
||||
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 scene_x_offset = 32
|
||||
local scene_y_offset = 8
|
||||
|
||||
intro_wait=40
|
||||
intro_step=0
|
||||
|
||||
function intro_init()
|
||||
game_update = intro_intro
|
||||
intro_wait=400
|
||||
surf.cls(16)
|
||||
|
||||
local font_default = font.current()
|
||||
font.current(font_sf)
|
||||
surf.target(back)
|
||||
surf.cls(16)
|
||||
draw.text("INTRO INIT",0,0,15)
|
||||
font.current(font_default)
|
||||
surf.target(0)
|
||||
surf.source(back)
|
||||
draw.surf(0,0,63,10,100,100,126,20)
|
||||
|
||||
-- surf.source(tiles)
|
||||
fade.fadein()
|
||||
print("INTRO INIT")
|
||||
end
|
||||
|
||||
function intro_intro()
|
||||
intro_wait=intro_wait-1
|
||||
|
||||
if intro_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then
|
||||
intro_wait=1
|
||||
game_update = intro_update
|
||||
fade.fadeoutin()
|
||||
end
|
||||
end
|
||||
|
||||
function intro_update()
|
||||
fps_print()
|
||||
game_init(true)
|
||||
fade.fadeoutin()
|
||||
end
|
||||
|
||||
|
||||
-- RESTOS DEL X2 CACAUS
|
||||
|
||||
function _draw_item_intro( name, flip )
|
||||
local cw = arcade_config.character_width
|
||||
local ch = arcade_config.character_height
|
||||
if ( name == "abad" ) then
|
||||
draw.surf(0,0,cw,ch,44*o2aX,24*o2aX,cw,ch,flip)
|
||||
elseif (name == "batman" ) then
|
||||
draw.surf(0,48*o2aX,cw,ch,82*o2aX,24*o2aX,cw,ch,flip)
|
||||
elseif (name == "cacaus" ) then
|
||||
draw.surf(112*o2aX,88*o2aX,cw,ch/2,76*o2aX,32*o2aX,cw,ch/2,flip)
|
||||
elseif (name == "marc" ) then
|
||||
draw.rect(15*o2aX,3*o2aX,99*o2aX,51*o2aX,2)
|
||||
elseif (name == "pas porta" ) then
|
||||
draw.rectf(73*o2aX,24*o2aX,7*o2aX,16*o2aX,16)
|
||||
end
|
||||
end
|
||||
|
||||
function _draw_escenari ()
|
||||
function draw_escenari ()
|
||||
surf.cls(16)
|
||||
draw_item_intro("marc",false)
|
||||
view.origin(16*o2aX,4*o2aX)
|
||||
view.origin(scene_x_offset, scene_y_offset)
|
||||
mapa_draw(10)
|
||||
-- Borrar la porta del mapa
|
||||
draw_item_intro("pas porta")
|
||||
end
|
||||
|
||||
function _intro_update()
|
||||
function draw_item_intro( name, flip )
|
||||
if ( name == "abad" ) then
|
||||
draw.surf(abad.x, abad.y, abad.w, abad.h, abad.dx, abad.dy, abad.dw, abad.dh, flip)
|
||||
elseif (name == "batman" ) then
|
||||
draw.surf(batman.x, batman.y, batman.w, batman.h, batman.dx, batman.dy, batman.dw, batman.dh, flip)
|
||||
elseif (name == "cacaus" ) then
|
||||
draw.surf(cacaus.x, cacaus.y, cacaus.w, cacaus.h, cacaus.dx, cacaus.dy, cacaus.dw, cacaus.dh, flip)
|
||||
elseif (name == "marc" ) then
|
||||
draw.rect(marc.x, marc.y, marc.w, marc.h, marc.color)
|
||||
elseif (name == "pas porta" ) then
|
||||
draw.rectf(pas_porta.x, pas_porta.y, pas_porta.w, pas_porta.h, pas_porta.color)
|
||||
end
|
||||
end
|
||||
|
||||
function intro_init()
|
||||
game_update = intro_intro
|
||||
intro_wait=400
|
||||
surf.source(tiles)
|
||||
surf.target(0)
|
||||
surf.cls(16)
|
||||
fade.fadein()
|
||||
font.current(font_sf)
|
||||
end
|
||||
|
||||
function intro_intro()
|
||||
intro_wait=1
|
||||
game_update = intro_update
|
||||
fade.fadeoutin()
|
||||
end
|
||||
|
||||
function intro_update()
|
||||
|
||||
if key.press(key.ESCAPE) or pad.press(btnPause) then
|
||||
game_init(true)
|
||||
fade.fadeoutin()
|
||||
@@ -75,10 +57,10 @@ function _intro_update()
|
||||
intro_wait=1
|
||||
end
|
||||
|
||||
|
||||
intro_wait=intro_wait-1
|
||||
if intro_wait==0 then
|
||||
-- STEP 0
|
||||
-- == INTRO_01
|
||||
-- STEP 0
|
||||
if intro_step==0 then
|
||||
draw_escenari()
|
||||
draw_item_intro("abad", true)
|
||||
@@ -88,7 +70,9 @@ function _intro_update()
|
||||
elseif intro_step==1 then
|
||||
start_scene(scenes.intro_01,58)
|
||||
intro_step=intro_step+1
|
||||
-- STEP 2
|
||||
|
||||
-- == INTRO_02
|
||||
-- STEP 2
|
||||
elseif intro_step==2 then
|
||||
draw_escenari()
|
||||
draw_item_intro("abad", false)
|
||||
@@ -98,7 +82,9 @@ function _intro_update()
|
||||
elseif intro_step==3 then
|
||||
start_scene(scenes.intro_02,58)
|
||||
intro_step=intro_step+1
|
||||
-- STEP 4
|
||||
|
||||
-- == INTRO_03
|
||||
-- STEP 4
|
||||
elseif intro_step==4 then
|
||||
draw_escenari()
|
||||
draw_item_intro("abad", false)
|
||||
@@ -110,7 +96,9 @@ function _intro_update()
|
||||
elseif intro_step==5 then
|
||||
start_scene(scenes.intro_03,58)
|
||||
intro_step=intro_step+1
|
||||
-- STEP 6
|
||||
|
||||
-- == INTRO_04
|
||||
-- STEP 6
|
||||
elseif intro_step==6 then
|
||||
draw_escenari()
|
||||
draw_item_intro("abad", false)
|
||||
@@ -120,7 +108,8 @@ function _intro_update()
|
||||
elseif intro_step==7 then
|
||||
start_scene(scenes.intro_04,58)
|
||||
intro_step=intro_step+1
|
||||
-- STEP 8
|
||||
|
||||
-- STEP 8
|
||||
elseif intro_step==8 then
|
||||
music.play(audio_main_song)
|
||||
game_init(true)
|
||||
|
||||
Reference in New Issue
Block a user