-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sword grunt #3660
add sword grunt #3660
Conversation
character-sfx.js
Outdated
currentCombo = this.player.getAction('use').animation ? | ||
this.player.getAction('use').animation // sword | ||
: | ||
this.player.getAction('use').animationCombo[this.player.avatar.useAnimationIndex] // silsword |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this mentioning app names? Apps have nothing to do with the engine.
character-sfx.js
Outdated
|
||
// combo | ||
const dispatchComboSoundEvent = (combo, indexOfCombo) =>{ | ||
this.dispatchEvent(new MessageEvent('comboSoundEmit', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a poor name for the event, not consistent with other events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Renamed event
webaverse/silsword@5d403c4
38d71b6
character-sfx.js
Outdated
this.currentComboIndex = 0; | ||
} | ||
case 0: { | ||
if(timestamp - this.playComboTime >= swordAnimationOffset[this.currentComboIndex]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this code is repeated, this is not a good way to write this method. There should not be any numerical state machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
remove state machine
I think the Both sword types/combo types should have the sword whoosh. The event name could be |
related: #3659
Sibling:
webaverse/silsword#12
sword does not have index.js to play its whoosh sound. Should I play the sound in totum?
Result:
Webaverse.-.Google.Chrome.2022-08-22.16-21-46.mp4