Ja escriu el text on toca en les escenes gracies al JailDoc. Gota ja es mostra com toca. Modificats uns quants sprites i tiles mes. Ja en queden pocs

This commit is contained in:
2026-03-17 18:10:54 +01:00
parent 336deaafa9
commit 1d2e72db47
5 changed files with 32 additions and 14 deletions

View File

@@ -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={} gota={}
function gota.new(_hab,_x,_y,_freq) function gota.new(_hab,_x,_y,_freq)
@@ -5,7 +15,12 @@ function gota.new(_hab,_x,_y,_freq)
end end
function gota:draw_normal() 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 end
function gota:update_normal() function gota:update_normal()
@@ -46,14 +61,14 @@ function gota:hit()
end end
function gota:draw_splash() function gota:draw_splash()
draw.circf(self.cx+self.dx,self.y,2,16) draw.circf( (self.cx+self.dx)*o2aX, self.y*o2aX, 2*o2aX, 16)
draw.circf(self.cx+self.dx,self.y,1,11) draw.circf( (self.cx+self.dx)*o2aX, self.y*o2aX, 1*o2aX, 11)
draw.circf(self.cx-self.dx,self.y,2,16) draw.circf( (self.cx-self.dx)*o2aX, self.y*o2aX, 2*o2aX, 16)
draw.circf(self.cx-self.dx,self.y,1,11) draw.circf( (self.cx-self.dx)*o2aX, self.y*o2aX, 1*o2aX, 11)
draw.circf(self.cx-(self.dx/2),self.y-4,2,16) draw.circf( (self.cx-(self.dx/2))*o2aX, (self.y-4)*o2aX, 2*o2aX, 16)
draw.circf(self.cx-(self.dx/2),self.y-4,1,11) draw.circf( (self.cx-(self.dx/2))*o2aX, (self.y-4)*o2aX, 1*o2aX, 11)
draw.circf(self.cx+(self.dx/2),self.y-4,2,16) draw.circf( (self.cx+(self.dx/2))*o2aX, (self.y-4)*o2aX, 2*o2aX, 16)
draw.circf(self.cx+(self.dx/2),self.y-4,1,11) draw.circf( (self.cx+(self.dx/2))*o2aX, (self.y-4)*o2aX, 1*o2aX, 11)
end end
function gota:update_splash() function gota:update_splash()

View File

@@ -132,6 +132,7 @@ function arc_text(str, x, y, col)
end end
function arc_textB(str, x, y, col) function arc_textB(str, x, y, col)
local ox, oy = view.origin()
local curr_surf_tgt = surf.target() local curr_surf_tgt = surf.target()
local curr_surf_src = surf.source() local curr_surf_src = surf.source()
local sw = arcade_config.org_resolucion.width 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 dw = arcade_config.resolucion.width
local dh = arcade_config.resolucion.height local dh = arcade_config.resolucion.height
surf.target(textsf) surf.target(textsf)
view.origin(0,0)
surf.cls(0) surf.cls(0)
draw.text(str,0,0,16) draw.text(str,0,0,16)
draw.text(str,1,0,16) draw.text(str,1,0,16)
@@ -153,6 +155,7 @@ function arc_textB(str, x, y, col)
-- print("arc_B "..str) -- print("arc_B "..str)
surf.source(textsf) surf.source(textsf)
surf.target(curr_surf_tgt) surf.target(curr_surf_tgt)
view.origin(ox,oy)
draw.surf(0,0,sw,sh,x,y,dw,dh) draw.surf(0,0,sw,sh,x,y,dw,dh)
surf.source(curr_surf_src) surf.source(curr_surf_src)
end end

View File

@@ -22,7 +22,7 @@ end
function premiere.draw() 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)*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 end
function premiere.hit() function premiere.hit()

View File

@@ -214,7 +214,7 @@ function draw_scene()
end end
elseif scenes.step==5 then elseif scenes.step==5 then
-- text(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x*o2aX,7*o2aX,2) -- 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) 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 if scenes.char<#scenes.current_scene[scenes.dnum].text[1] then
scenes.step=scenes.step-1 scenes.step=scenes.step-1
@@ -225,7 +225,7 @@ function draw_scene()
end end
elseif scenes.step==6 then elseif scenes.step==6 then
-- text(string.sub(scenes.current_scene[scenes.dnum].text[2],1,scenes.char),txt_x*o2aX,15*o2aX,2) -- 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) 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 if scenes.char<#scenes.current_scene[scenes.dnum].text[2] then
scenes.step=scenes.step-1 scenes.step=scenes.step-1
@@ -236,7 +236,7 @@ function draw_scene()
end end
elseif scenes.step==7 then elseif scenes.step==7 then
-- text(string.sub(scenes.current_scene[scenes.dnum].text[3],1,scenes.char),txt_x*o2aX,23*o2aX,2) -- 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) 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 if scenes.char<#scenes.current_scene[scenes.dnum].text[3] then
scenes.step=scenes.step-1 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[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[2],txt_x*o2aX,15*o2aX,2)
-- text(scenes.current_scene[scenes.dnum].text[3],txt_x*o2aX,23*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[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[2],txt_x*o2aX,15*o2aX,2)
arc_textB(scenes.current_scene[scenes.dnum].text[3],txt_x*o2aX,23*o2aX,2) arc_textB(scenes.current_scene[scenes.dnum].text[3],txt_x*o2aX,23*o2aX,2)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB