Flying Cacos! Canvis en viewport:inside i adaptat cacau a la nova capçalera

This commit is contained in:
2026-03-24 20:58:19 +01:00
parent e28e053cb4
commit ef18447712
4 changed files with 110 additions and 8 deletions

View File

@@ -3,9 +3,9 @@
type_shot={linear=1, rear=2, way3=3}
cacau={
{ hab=-1, x=0, y=0, wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 },
{ hab=-1, x=0, y=0, wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 },
{ hab=-1, x=0, y=0, wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 }
{ hab=-1, x=0, y=0, w=12 ,h=8 ,wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 },
{ hab=-1, x=0, y=0, w=12 ,h=8 ,wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 },
{ hab=-1, x=0, y=0, w=12 ,h=8 ,wait=0, flip=false, bb={x=0,y=0,w=4,h=4}, alive=false, power=1 }
}
-- function cacau.init(_hab,_x,_y,_flip)
@@ -64,7 +64,7 @@ end
function cacau.update()
for ns=1,3 do
if cacau[ns].alive==true then
if viewp:inside(cacau[ns].x, cacau[ns].y)==false then
if viewp:inside(cacau[ns].x, cacau[ns].y, cacau[ns].w, cacau[ns].h)==false then
cacau[ns].hab=-1
cacau[ns].alive=false
break
@@ -80,7 +80,7 @@ function cacau.update()
if cacau[ns].flip then step=-step end
cacau[ns].x=cacau[ns].x+step
if viewp:inside(cacau[ns].x, cacau[ns].y)==false then
if viewp:inside(cacau[ns].x, cacau[ns].y, cacau[ns].w, cacau[ns].h)==false then
cacau[ns].alive=false
break
end