Commits

Anonymous committed 45eed3c

added gameover

Comments (0)

Files changed (1)

   --print("add:b")
   --print(to_string(b))
   if a.tipo=="object" or b.tipo=="object" then
-  	print("add2")
  		local _obj=b
  		local _oth=a
   	if b.tipo=="object" then
   		_obj=a
   		_oth=b
     end
-    print("add3")
     if _oth.tipo=="objects" or _oth.tipo=="board_bottom" then
-    	print("add4")
+    	if _obj.value.body:getY()<state.board.y+5 then
+    	  Gamestate.switch(Gamestate.gameover)
+    	end
     	_obj.value:stopInteractive()
     	table.insert(state.objects,_obj.value)
 		  state.object=_G.object:new(pLevel,state.board,state.world,true,true,false)
 		  state.next=_G.object:new(pLevel,state.board,state.world,false,false,true)
     end
   end
-  print("add-fine")
 end
 
 function persistCollision(a, b, coll)