fireball={ hab=-1, x=0, y=0, w=6, h=6, wait=0, flip=false, step_length=3, power=1, size=1, bb={x=0,y=0,w=4,h=4}, x1=0, y1=0, step_length_x=1, step_length_y=1, } function fireball.init(_hab,_x,_y,_flip, _off_x, _off_y, _power) local world_x, world_y = coords.room_to_world(_hab,_x,_y) _power = _power or 1 if fireball.hab ~= -1 then return end _off_x = _off_x or 0 _off_y = _off_y or 0 fireball.hab=_hab fireball.x= world_x+_off_x fireball.y= world_y+_off_y fireball.flip=_flip fireball.power=_power fireball.size=1 fireball.w = 6 fireball.h = 6 fireball.bb = {x=0,y=0,w=4,h=4} end function fireball.draw() if fireball.hab == -1 then return end local scr_x, scr_y = viewp:screen_coords( fireball.x, fireball.y ) draw.circf(scr_x,scr_y,8*fireball.size,16) draw.circf(scr_x,scr_y,6*fireball.size,3) draw.circf(scr_x,scr_y,2*fireball.size,8) end function fireball.update() if fireball.power==2 and fireball.power>fireball.size then fireball.wait = fireball.wait + 1 fireball.x1=abad.x+abad.bb.x+(abad.bb.w//2) fireball.y1=abad.y if abad.x