From eb88c017eaa2dee5b3948db74533a74b02608451 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 20 Jul 2019 17:46:56 +0200 Subject: [PATCH] feat(action3D): add collision between coin and player actors --- examples/gameplay/action3D/actors/player.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/gameplay/action3D/actors/player.lua b/examples/gameplay/action3D/actors/player.lua index 85327b8..6d65ddb 100644 --- a/examples/gameplay/action3D/actors/player.lua +++ b/examples/gameplay/action3D/actors/player.lua @@ -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