-- local arcade_config = require("arcade_config") type_shot={linear=1, rear=2, way3=3} cacau={ { 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) -- if cacau.hab ~= -1 then return end -- cacau.hab=_hab -- cacau.x=_x -- cacau.y=_y -- cacau.flip=_flip -- cacau.alive = true -- end function cacau.init(_x,_y,_flip,_power,_num_shots,_type_shot) if _type_shot==type_shot.linear then for ns=1,_num_shots do if cacau[ns].alive == true then break end cacau[ns].x=_x cacau[ns].y=_y cacau[ns].flip=_flip cacau[ns].alive = true cacau[ns].power = _power end elseif _type_shot==type_shot.rear then elseif _type_shot==type_shot.way3 then end end function cacau:available(_num_shots,_type_shot) local avail_shots = false if _type_shot==type_shot.linear then for ns=1,_num_shots do if cacau[ns].alive == false then avail_shots = true end end elseif _type_shot==type_shot.rear then elseif _type_shot==type_shot.way3 then end return avail_shots end function cacau.draw() for ns=1,3 do if cacau[ns].alive==true then local cx, cy = viewp:screen_coords(cacau[ns].x, cacau[ns].y) draw.circf( cx, cy, 4,16) draw.circf( cx+4, cy, 4,16) draw.circf( cx , cy, 2,6) draw.circf( cx+4, cy, 2,6) end end end function cacau.update() for ns=1,3 do if cacau[ns].alive==true 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 end end cacau[ns].wait=cacau[ns].wait+1 if cacau[ns].wait == 3 then cacau[ns].wait = 0 end if arc_check_tile(cacau[ns].x,cacau[ns].y)96 then -- cacau.hab=-1 -- cacau.alive = false -- return -- elseif check_tile(cacau.hab,cacau.x,cacau.y)