From e602c4dfe5a6ef765ec1511183d87e78faee16c2 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 6 Jun 2019 00:21:11 -0500 Subject: [PATCH] fun: fade that sucker out and don't collide --- server/fixtures/rock-projectile.entity.js | 30 +++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/server/fixtures/rock-projectile.entity.js b/server/fixtures/rock-projectile.entity.js index a2bc39a..91a48b7 100644 --- a/server/fixtures/rock-projectile.entity.js +++ b/server/fixtures/rock-projectile.entity.js @@ -40,10 +40,23 @@ export function rockProjectileJSON() { 0.5, ], ); + const setIsNotColliding = buildTraversal( + ['entity', 'isColliding'], + false, + ); const setIsNotDamaging = buildTraversal( ['entity', 'isDamaging'], false, ); + const fadeOut = buildInvoke( + ['entity', 'transition'], + [ + { + opacity: 0, + }, + 0.2, + ], + ); const reflect = buildInvoke( ['entity', 'moveFor'], [ @@ -54,7 +67,19 @@ export function rockProjectileJSON() { buildTraversal(['obstacle', 'position']), ], ), - 0.05, + 0.2, + ], + ); + const afterImpact = buildInvoke( + ['global', 'parallel'], + [ + { + type: 'actions', + traversals: [ + fadeOut, + reflect, + ], + }, ], ); // Destroy. @@ -87,8 +112,9 @@ export function rockProjectileJSON() { routine: { type: 'actions', traversals: [ + setIsNotColliding, setIsNotDamaging, - reflect, + afterImpact, destroy, ], },