Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/11/2014, 13:04
Avatar de Polu
Polu
 
Fecha de Ingreso: febrero-2003
Mensajes: 135
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: Cambiar evento touch por otro de collision

Hola de nuevo, me responderé a mi mismo.

Machacando y machacando al final he dado con la solución, dejo el script por si a alguien le interesa:
Código C:
Ver original
  1. local function onCollision_2(event)
  2.     if event.phase == "began" then
  3.  
  4.         local agro = event.object1
  5.         local hit = event.object2
  6.  
  7.         if agro.type == "crate" and hit.type == "grass" then
  8.  
  9.         elseif agro.type == "grass" and hit.type == "crate" then
  10.        
  11.  
  12.        score.add(500)-------CODE PARA LA PUNTUACIÓN------------
  13.  
  14.  
  15.         end
  16.     end
  17. end
  18.  
  19.  
  20.     Runtime:addEventListener("collision", onCollision_2)

Bye: