feat(action3D): add collision between coin and player actors
This commit is contained in:
parent
54167f8a77
commit
eb88c017ea
1 changed files with 6 additions and 0 deletions
|
@ -63,6 +63,12 @@ function Player:setDirection(direction)
|
|||
end
|
||||
end
|
||||
|
||||
function Player:collisionResponse(collision)
|
||||
if collision.other.type == "coin" then
|
||||
collision.other.owner:takeCoin(self)
|
||||
end
|
||||
end
|
||||
|
||||
function Player:draw()
|
||||
Player.super.draw(self)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue