El joc ja quasi es jugable. Falten els cacaus, el dispar de l'imp i alguns ajustos de posicions d'elements

This commit is contained in:
2026-03-15 23:00:25 +01:00
parent 5f8e13706c
commit d890da0a47
7 changed files with 89 additions and 58 deletions

View File

@@ -155,7 +155,7 @@ function game_init(menu)
end
function draw_hab(hab,x,y,editing)
view.origin(x,y)
view.origin(x*o2aX,y*o2aX)
mapa_draw(hab)
if not editing then
@@ -173,11 +173,11 @@ function draw_hab(hab,x,y,editing)
end
function update_dialog()
draw.rectf(16,16,97,35,12)
draw.rect(15,15,99,37,16)
text("Save the map?",20,20,2)
text("This cannot be undone",20,27,2)
text("(Y)es (N)o",25,40,2)
draw.rectf(16*o2aX,16*o2aX,97*o2aX,35*o2aX,12)
draw.rect(15*o2aX,15*o2aX,99*o2aX,37*o2aX,16)
text("Save the map?",20*o2aX,20*o2aX,2)
text("This cannot be undone",20*o2aX,27*o2aX,2)
text("(Y)es (N)o",25*o2aX,40*o2aX,2)
if key.press(key.N) then
game_update=update_game
@@ -193,13 +193,13 @@ function update_game()
if mode==modes.editing then
draw_hab(abad.hab,0,0,true)
text(abad.hab,120,1,2)
text(abad.hab,120*o2aX,1*o2aX,2)
draw.surf(0,64+scroll*8,128,48,0,48)
draw.surf(0,(64+scroll*8)*o2aX,128*o2aX,48*o2aX,0,48*o2aX)
local xx=(seltile&15)*8
local yy=48+(seltile>>4)*8
draw.rect(xx,yy,9,9, 3)
text("EDIT",100,1,3)
draw.rect(xx*o2aX,yy*o2aX,9*o2aX,9*o2aX, 3)
text("EDIT",100*o2aX,1*o2aX,3)
local hx = abad.hab%10
local hy = math.floor(abad.hab/10)
scroll=0
@@ -227,9 +227,9 @@ function update_game()
local mx,my=mouse.pos()
if mx>>3 < 12 and my>>3 < 6 then
text(mx>>3,100,10,2)
text(my>>3,111,10,2)
text((mx>>3)+(my>>3)*12,118,10,2)
text(mx>>3,100*o2aX,10*o2aX,2)
text(my>>3,111*o2aX,10*o2aX,2)
text(((mx>>3)+(my>>3)*12)*o2aX,118*o2aX,10*o2aX,2)
end
if mouse.down(mouse.LEFT) then
if my>=48 then
@@ -244,25 +244,25 @@ function update_game()
end
if mx>>3 < 12 and my>>3 < 6 then
local tx,ty=(mx>>3)<<3,(my>>3)<<3
draw.rect(tx,ty,9,9,3)
draw.rect(tx*o2aX,ty*o2aX,9*o2aX,9*o2aX,3)
end
else
if abad.hurting == 0 then
draw_hab(abad.hab,0,0)
--text(abad.hab,1,1,2)
draw_hab(cameras[current_camera].hab,0,48)
text(camera_names[current_camera],2,49,8)
text(camera_names[current_camera],2*o2aX,49*o2aX,8)
score.draw()
surf.source(tiles)
draw.text("x"..abad.vides,114,13,2)
draw.rectf(102+(abad.energia>>1),30,21-(abad.energia>>1),8,16)
draw.text("x"..abad.vides,114*o2aX,13*o2aX,2)
draw.rectf((102+(abad.energia>>1))*o2aX,30*o2aX,(21-(abad.energia>>1))*o2aX,8*o2aX,16)
else
draw.surf(0,0,16,9,50,40,16,9,true)
draw.surf(0,0,16*o2aX,9*o2aX,50*o2aX,40*o2aX,16*o2aX,9*o2aX,true)
if abad.hurting > 40 then
draw.text("x"..abad.vides+1,63,43,3)
draw.text("x"..abad.vides+1,63*o2aX,43*o2aX,3)
elseif abad.hurting < 20 then
draw.text("x"..abad.vides,63,43,2)
draw.text("x"..abad.vides,63*o2aX,43*o2aX,2)
end
end
@@ -316,7 +316,7 @@ function update_game()
end
function redraw_menu_hab()
draw_hab(menu_room,16*o2aX,41*o2aX)
draw_hab(menu_room,16,41)
draw.rectf(0,0,15*o2aX,97*o2aX,16)
draw.rectf(114*o2aX,0,78*o2aX,97*o2aX,16)
draw.rect(15*o2aX,40*o2aX,99*o2aX,50*o2aX,2)
@@ -581,7 +581,7 @@ end
function pause()
surf.source(0)
surf.target(back)
draw.surf(0,0,128,96,0,0)
draw.surf(0,0,128*o2aX,96*o2aX,0,0)
surf.target(0)
surf.source(tiles)
pausa_option=1
@@ -622,7 +622,7 @@ function update_pause()
if key.press(key.ESCAPE) then
surf.source(back)
draw.surf(0,0,128,96,0,0)
draw.surf(0,0,128*o2aX,96*o2aX,0,0)
surf.source(tiles)
game_update = pause_old_update
elseif key.press(keyDown) or pad.press(btnDown) then
@@ -634,7 +634,7 @@ function update_pause()
elseif key.press(keyShoot) or pad.press(btnShoot) then
if pausa_option==1 then
surf.source(back)
draw.surf(0,0,128,96,0,0)
draw.surf(0,0,128*o2aX,96*o2aX,0,0)
surf.source(tiles)
game_update = pause_old_update
elseif pausa_option==2 then