-
Notifications
You must be signed in to change notification settings - Fork 83
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
Mobile support for controlling bird #27
Conversation
sketch.js
Outdated
@@ -28,7 +32,7 @@ function draw() { | |||
background(0); | |||
// Draw our background image, then move it at the same speed as the pipes | |||
image(bgImg, bgX, 0, bgImg.width, height); | |||
bgX -= pipes[0].speed; | |||
bgX -= speed*0.5; |
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.
I would prefer this change (Parallax, using a speed variable) to be separated from the touch controls PR, please. Also you misspelt speed in your variable declaration.
Oops i meant to change those in another branch then make it a separate pull request |
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.
I'll leave @shiffman to chose whether to merge
I like having this here! I wonder -- is there a simpler way to implement just using the p5 touch events and not worrying about multi-touch? |
@shiffman there is.... Just add. Not gonna commit myself, as it will not be approved anyway :D
|
I have tried that before and for some reason the bird jumps twice when touching quickly. Seems to be an issue with p5 and chrome 56: |
I'm 50% (xD) sure that it will work properly on mobile (not in chrome dev mode) |
Just tested it again and still the same thing, press once quickly and the bird jumps twice (when touch starts and ends) |
I accidentally made a typo when resolving merge conflicts.
Awesome! Thank you! |
Uses
touches
from p5 to check if user has touched screenprobably not that useful