diff --git a/data/game.ini b/data/game.ini index 8b73789..fd05cef 100644 --- a/data/game.ini +++ b/data/game.ini @@ -1,5 +1,5 @@ title=X2 Cacaus -config=cacaus +config=x2cacaus width=256 height=192 zoom=3 diff --git a/data/scenes.lua b/data/scenes.lua index 71dd677..17a932d 100644 --- a/data/scenes.lua +++ b/data/scenes.lua @@ -14,9 +14,6 @@ avatar_premiere_x = 69*o2aX avatar_premiere_y = 20*o2aX avatar_elalien_x = 3*o2aX avatar_elalien_y = 16*o2aX -avatar_w = 10*o2aX -avatar_h = 10*o2aX - scenes={ intro_01= { @@ -180,6 +177,37 @@ function playtext(snd) end end +function draw_photo ( photo_x, photo_y, flip, step ) + local photo_w = 11*o2aX + local photo_h = 10*o2aX + + local bkg_x = 8*o2aX + local bkg_y = 12*o2aX + local bkg_w = photo_w*2+2 + local bkg_h = photo_h*2+2 + local bkg_color = 16 + + if flip then + bkg_x = 96*o2aX+1 + end + + if step==3 then + bkg_y = 12*o2aX + bkg_h = 12*o2aX + elseif step==4 or step==8 then + bkg_y = 7*o2aX + bkg_h = photo_h*2+2 + end + + local photo_dx = bkg_x+1 + local photo_dy = bkg_y+1 + local photo_dw = bkg_w-2 + local photo_dh = bkg_h-2 + + draw.rectf(bkg_x,bkg_y,bkg_w,bkg_h,bkg_color) + draw.surf(photo_x,photo_y,photo_w,photo_h,photo_dx,photo_dy,photo_dw,photo_dh, flip) +end + function draw_scene() local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8 @@ -197,21 +225,9 @@ function draw_scene() draw.line(0,0,128*o2aX,0,16) draw.line(0,34*o2aX+1,128*o2aX,34*o2aX+1,16) elseif scenes.step==3 then - if not scenes.current_scene[scenes.dnum].flip then - draw.rectf(8*o2aX,12*o2aX,24*o2aX,12*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,9*o2aX,13*o2aX,20*o2aX,10*o2aX) - else - draw.rectf(97*o2aX,12*o2aX,24*o2aX,12*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,98*o2aX,13*o2aX,20*o2aX,10*o2aX,true) - end + draw_photo ( scenes.current_scene[scenes.dnum].x, scenes.current_scene[scenes.dnum].y, scenes.current_scene[scenes.dnum].flip, scenes.step) elseif scenes.step==4 then - if not scenes.current_scene[scenes.dnum].flip then - draw.rectf(8*o2aX,7*o2aX,24*o2aX,22*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,9*o2aX,8*o2aX,20*o2aX,20*o2aX) - else - draw.rectf(97*o2aX,7*o2aX,24*o2aX,22*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,98*o2aX,8*o2aX,20*o2aX,20*o2aX,true) - end + draw_photo ( scenes.current_scene[scenes.dnum].x, scenes.current_scene[scenes.dnum].y, scenes.current_scene[scenes.dnum].flip, scenes.step) elseif scenes.step==5 then -- text(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x*o2aX,7*o2aX,2) -- view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? @@ -249,17 +265,17 @@ function draw_scene() draw.rectf(0,0,129*o2aX,35*o2aX,12) draw.line(0,0,128*o2aX,0,16) draw.line(0,34*o2aX+1,128*o2aX,34*o2aX+1,16) - if not scenes.current_scene[scenes.dnum].flip then - draw.rectf(8*o2aX,7*o2aX,24*o2aX,22*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,9*o2aX,8*o2aX,20*o2aX,20*o2aX) - else - draw.rectf(97*o2aX,7*o2aX,24*o2aX,22*o2aX,16) - draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,98*o2aX,8*o2aX,20*o2aX,20*o2aX,true) - end + draw_photo ( scenes.current_scene[scenes.dnum].x, scenes.current_scene[scenes.dnum].y, scenes.current_scene[scenes.dnum].flip, scenes.step) + -- if not scenes.current_scene[scenes.dnum].flip then + -- draw.rectf(8*o2aX,7*o2aX,24*o2aX,22*o2aX,16) + -- draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,9*o2aX,8*o2aX,20*o2aX,20*o2aX) + -- else + -- draw.rectf(97*o2aX,7*o2aX,24*o2aX,22*o2aX,16) + -- draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,avatar_w,avatar_h,98*o2aX,8*o2aX,20*o2aX,20*o2aX,true) + -- end -- text(scenes.current_scene[scenes.dnum].text[1],txt_x*o2aX,7*o2aX,2) -- text(scenes.current_scene[scenes.dnum].text[2],txt_x*o2aX,15*o2aX,2) -- text(scenes.current_scene[scenes.dnum].text[3],txt_x*o2aX,23*o2aX,2) - -- view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? arc_textB(scenes.current_scene[scenes.dnum].text[1],txt_x*o2aX,7*o2aX,2) arc_textB(scenes.current_scene[scenes.dnum].text[2],txt_x*o2aX,15*o2aX,2) arc_textB(scenes.current_scene[scenes.dnum].text[3],txt_x*o2aX,23*o2aX,2) diff --git a/data/tiles.gif b/data/tiles.gif index 1ba5b25..8de6b19 100644 Binary files a/data/tiles.gif and b/data/tiles.gif differ