El monstruitos ja fan pupa
This commit is contained in:
@@ -136,6 +136,7 @@ function abad_hurt(howmuch)
|
|||||||
surf.cls(3)
|
surf.cls(3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
abad.respawning = 120
|
||||||
end
|
end
|
||||||
|
|
||||||
function abad_do_jump ( jumpfwd )
|
function abad_do_jump ( jumpfwd )
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ function caco:update_normal()
|
|||||||
self.flip=not self.flip
|
self.flip=not self.flip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if viewp:inside(self.x, self.y, self.w, self.h) then
|
||||||
|
if collision(abad,self) then
|
||||||
|
abad_hurt(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- if self.hab==abad.hab then
|
-- if self.hab==abad.hab then
|
||||||
-- if aabb(abad,self) then
|
-- if aabb(abad,self) then
|
||||||
|
|||||||
@@ -175,16 +175,11 @@ function update_game()
|
|||||||
arc_mapa_update()
|
arc_mapa_update()
|
||||||
|
|
||||||
|
|
||||||
|
-- Moure a tots
|
||||||
for key,actor in pairs(actors) do
|
for key,actor in pairs(actors) do
|
||||||
actor:update()
|
actor:update()
|
||||||
--if actor.hab==cacau.hab and actor~=abad then
|
|
||||||
-- if aabb(actor,cacau) then
|
-- Comprovar dispars contra "monstres"
|
||||||
-- if actor.hit~=nil then
|
|
||||||
-- actor:hit()
|
|
||||||
-- cacau.hab=-1
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--end
|
|
||||||
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
|
if viewp:inside(actor.x, actor.y, actor.w, actor.h) and actor~=abad then
|
||||||
for _, cacau_shot in pairs(cacau.shots()) do
|
for _, cacau_shot in pairs(cacau.shots()) do
|
||||||
if cacau_shot.alive and collision(actor,cacau_shot) then
|
if cacau_shot.alive and collision(actor,cacau_shot) then
|
||||||
@@ -200,6 +195,7 @@ function update_game()
|
|||||||
cacau.update()
|
cacau.update()
|
||||||
switches.update()
|
switches.update()
|
||||||
|
|
||||||
|
-- Moure el viewport
|
||||||
local vp_x = viewp.x
|
local vp_x = viewp.x
|
||||||
local vp_y = viewp.y
|
local vp_y = viewp.y
|
||||||
--viewp:position(vp_x, vp_y)
|
--viewp:position(vp_x, vp_y)
|
||||||
@@ -214,6 +210,8 @@ function update_game()
|
|||||||
if vp_y < 0 then vp_y = 0 end
|
if vp_y < 0 then vp_y = 0 end
|
||||||
|
|
||||||
viewp:position(vp_x, vp_y)
|
viewp:position(vp_x, vp_y)
|
||||||
|
|
||||||
|
-- Pintar la finestra del mon
|
||||||
render_map(sf_mapa, tiles, vp_x, vp_y)
|
render_map(sf_mapa, tiles, vp_x, vp_y)
|
||||||
|
|
||||||
for key,actor in pairs(actors) do
|
for key,actor in pairs(actors) do
|
||||||
|
|||||||
@@ -74,6 +74,17 @@ function gota:update_normal()
|
|||||||
--self.flip=not self.flip
|
--self.flip=not self.flip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if viewp:inside(self.x, self.y, self.w, self.h) then
|
||||||
|
if collision(abad,self) then
|
||||||
|
abad_hurt(1)
|
||||||
|
self.update=gota.update_splash
|
||||||
|
self.draw=gota.draw_splash
|
||||||
|
self.cx=self.x+2
|
||||||
|
self.dx=0
|
||||||
|
self.dy=-4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- if self.hab==abad.hab then
|
-- if self.hab==abad.hab then
|
||||||
-- if aabb(abad,self) then
|
-- if aabb(abad,self) then
|
||||||
-- abad_hurt(1)
|
-- abad_hurt(1)
|
||||||
|
|||||||
@@ -62,6 +62,12 @@ function zombie:update_normal()
|
|||||||
self.flip=not self.flip
|
self.flip=not self.flip
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if viewp:inside(self.x, self.y, self.w, self.h) then
|
||||||
|
if collision(abad,self) then
|
||||||
|
abad_hurt(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- if self.hab==abad.hab then
|
-- if self.hab==abad.hab then
|
||||||
-- if aabb(abad,self) then
|
-- if aabb(abad,self) then
|
||||||
-- abad_hurt(1)
|
-- abad_hurt(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user