-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/control bounce #2
Conversation
Number of frames during with the player pressed the spacebar during the 'bouncing phase' and compared to the total number of frame during this phase.
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.
Waiting for second iteration :p
There's something weird with the distance I get when I play. They are statistically strange. Here is the log of the frame difference between the bounce and the input:
|
OK i fixed it, the input being not debounced, it was being registered again after the bounce resolution. |
src/js/game/states/play.js
Outdated
makeSplash(game, disc); | ||
this.bouncer.bounce(); | ||
}); | ||
} |
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 removing them from the callback ?
Is there any benefits in terms of speed / precision ?
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.
well the callback is synchronous, so yeah, it allows to do branch on collide = false
too
// The disc was too slow and killed | ||
if (!disc.alive) { | ||
// Reset the game later | ||
setTimeout(() => { |
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.
wasn't the restartTimeout
solving the issue of the restart()
being triggered multiple times?
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.
It is, but I find this cleaner, and it does not use any additional reference
ebc9dcf
to
83cd45a
Compare
No description provided.