Flying Cacos! Canvis en viewport:inside i adaptat cacau a la nova capçalera
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user