Skip to content

Commit

Permalink
feat: add failure sound and event for non-destination delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridwanah committed Aug 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 668496a commit 636ceed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions game/static/game/js/model.js
Original file line number Diff line number Diff line change
@@ -395,6 +395,22 @@ ocargo.Model.prototype.deliver = function() {
popupHint: ocargo.game.registerFailure(),
description: 'tried to deliver at non-destination'
});

ocargo.animation.appendAnimation({
type: 'callable',
functionType: 'playSound',
functionCall: ocargo.sound.failure,
description: 'failure sound'
});

ocargo.event.sendEvent("DeliverNonDestination", { levelName: LEVEL_NAME,
defaultLevel: DEFAULT_LEVEL,
workspace: ocargo.blocklyControl.serialize(),
failures: this.failures,
pythonWorkspace: ocargo.pythonControl.getCode()
});
this.reasonForTermination = 'DELIVER_AT_NON_DESTINATION';
return false;
}
return destination;
};

0 comments on commit 636ceed

Please sign in to comment.