diff --git a/data/gota.lua b/data/gota.lua index e34a148..4edb6b5 100644 --- a/data/gota.lua +++ b/data/gota.lua @@ -1,3 +1,13 @@ +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 +-- posició en el gif +gota_gif_col = 7 +gota_gif_row = 0 + gota={} function gota.new(_hab,_x,_y,_freq) @@ -5,7 +15,12 @@ function gota.new(_hab,_x,_y,_freq) end function gota:draw_normal() - draw.surf(112,0,8,8,self.x,self.y) + -- draw.surf(112,0,8,8,self.x,self.y) + local x = gota_gif_col*cw + local y = gota_gif_row*ch + local cw= 8*o2aX + local ch= 8*o2aX + draw.surf(x,y,cw,ch,self.x*o2aX,self.y*o2aX) end function gota:update_normal() @@ -46,14 +61,14 @@ function gota:hit() end function gota:draw_splash() - draw.circf(self.cx+self.dx,self.y,2,16) - draw.circf(self.cx+self.dx,self.y,1,11) - draw.circf(self.cx-self.dx,self.y,2,16) - draw.circf(self.cx-self.dx,self.y,1,11) - draw.circf(self.cx-(self.dx/2),self.y-4,2,16) - draw.circf(self.cx-(self.dx/2),self.y-4,1,11) - draw.circf(self.cx+(self.dx/2),self.y-4,2,16) - draw.circf(self.cx+(self.dx/2),self.y-4,1,11) + draw.circf( (self.cx+self.dx)*o2aX, self.y*o2aX, 2*o2aX, 16) + draw.circf( (self.cx+self.dx)*o2aX, self.y*o2aX, 1*o2aX, 11) + draw.circf( (self.cx-self.dx)*o2aX, self.y*o2aX, 2*o2aX, 16) + draw.circf( (self.cx-self.dx)*o2aX, self.y*o2aX, 1*o2aX, 11) + draw.circf( (self.cx-(self.dx/2))*o2aX, (self.y-4)*o2aX, 2*o2aX, 16) + draw.circf( (self.cx-(self.dx/2))*o2aX, (self.y-4)*o2aX, 1*o2aX, 11) + draw.circf( (self.cx+(self.dx/2))*o2aX, (self.y-4)*o2aX, 2*o2aX, 16) + draw.circf( (self.cx+(self.dx/2))*o2aX, (self.y-4)*o2aX, 1*o2aX, 11) end function gota:update_splash() diff --git a/data/main.lua b/data/main.lua index 37f833e..19ba324 100644 --- a/data/main.lua +++ b/data/main.lua @@ -132,6 +132,7 @@ function arc_text(str, x, y, col) end function arc_textB(str, x, y, col) + local ox, oy = view.origin() local curr_surf_tgt = surf.target() local curr_surf_src = surf.source() local sw = arcade_config.org_resolucion.width @@ -139,6 +140,7 @@ function arc_textB(str, x, y, col) local dw = arcade_config.resolucion.width local dh = arcade_config.resolucion.height surf.target(textsf) + view.origin(0,0) surf.cls(0) draw.text(str,0,0,16) draw.text(str,1,0,16) @@ -153,6 +155,7 @@ function arc_textB(str, x, y, col) -- print("arc_B "..str) surf.source(textsf) surf.target(curr_surf_tgt) + view.origin(ox,oy) draw.surf(0,0,sw,sh,x,y,dw,dh) surf.source(curr_surf_src) end \ No newline at end of file diff --git a/data/premiere.lua b/data/premiere.lua index beabe08..620f473 100644 --- a/data/premiere.lua +++ b/data/premiere.lua @@ -22,7 +22,7 @@ end function premiere.draw() -- draw.surf((premiere.frame&7)*16,(premiere.frame>>3)*16,16,16,premiere.x,premiere.y,16,16,premiere.flip) - draw.surf((premiere.frame&7)*cw,(premiere.frame>>cxr2)*ch,cw,ch,premiere.x*o2aX,premiere.y*o2aX,cw,ch,flip) + draw.surf((premiere.frame&7)*cw,(premiere.frame>>cxr2)*ch,cw,ch,premiere.x*o2aX,premiere.y*o2aX,cw,ch,premiere.flip) end function premiere.hit() diff --git a/data/scenes.lua b/data/scenes.lua index 66f23a2..71dd677 100644 --- a/data/scenes.lua +++ b/data/scenes.lua @@ -214,7 +214,7 @@ function draw_scene() end 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? + -- view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? arc_textB(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x*o2aX,7*o2aX,2) if scenes.char<#scenes.current_scene[scenes.dnum].text[1] then scenes.step=scenes.step-1 @@ -225,7 +225,7 @@ function draw_scene() end elseif scenes.step==6 then -- text(string.sub(scenes.current_scene[scenes.dnum].text[2],1,scenes.char),txt_x*o2aX,15*o2aX,2) - view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? + -- view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? arc_textB(string.sub(scenes.current_scene[scenes.dnum].text[2],1,scenes.char),txt_x*o2aX,15*o2aX,2) if scenes.char<#scenes.current_scene[scenes.dnum].text[2] then scenes.step=scenes.step-1 @@ -236,7 +236,7 @@ function draw_scene() end elseif scenes.step==7 then -- text(string.sub(scenes.current_scene[scenes.dnum].text[3],1,scenes.char),txt_x*o2aX,23*o2aX,2) - view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? + -- view.origin(0,scenes.offset-20) -- Ni idea de perquè 38, o es 19*o2aX? arc_textB(string.sub(scenes.current_scene[scenes.dnum].text[3],1,scenes.char),txt_x*o2aX,23*o2aX,2) if scenes.char<#scenes.current_scene[scenes.dnum].text[3] then scenes.step=scenes.step-1 @@ -259,7 +259,7 @@ function draw_scene() -- 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? + -- 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 a00ebc9..7390bff 100644 Binary files a/data/tiles.gif and b/data/tiles.gif differ