0

I know there is a similar question: Smooth fly movement like flappy bird or jet pack joy ride with gravity and Accelaration

But I don't understand how to check if isFlapping is true and to use this information to start the flight of the bird...

Because here:

dY += gravity + flapping;
y += dY;
bird.setY(y);

the flapping action will be used all the time but not only when the user touches the screen. Please help

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
Nils Be
  • 45
  • 1
  • 4
  • is flapping is true when user taps the screen, right? then make it false after x amount of time. – letsCode Jun 12 '18 at 17:22
  • Yes, but how can I check the boolean before + flapping, because I tried to leave that out and to add the flapping int on clicking the screen, but then the fly effect doesn't work... – Nils Be Jun 12 '18 at 17:25
  • what ide are you using? – letsCode Jun 12 '18 at 17:38
  • I use Android Studio – Nils Be Jun 12 '18 at 17:41
  • ok. so if you click of having a "fly" button. tap it, were flying. tap it, disable for half a second or so... then another half second bird drops. or whatever your logic is. the button is how you know its flapping really. you have a global variable thats true/false. if its done in unity, it would actually be a lot easier. – letsCode Jun 12 '18 at 17:43

0 Answers0