I am using the
“How to Make a Flappy Bird Game with V-Play”
page as a guide for creating my own type of Flappy Bird, but I am having problems with this one part:
The game will have 3 states:
- wait: Pipes will not move, game starts after the first touch on the screen.
- play: Actual game.
- gameOver: Player hits a pipe or the ground and falls down to the ground. The next touch on the screen will reset the game.
Add a custom property to the Scene in main.qml like this:
property string gameState: "wait"
We will begin with the wait state, by setting it as default value.
Then we can use this state to control the gravity, with a property binding
gravity.y: scene.gameState != "wait" ? -27 : 0
Basically, I don’t understand what to do here. I think what I’m missing is the custom property part or property binding part. I have tried putting the property string gameState: “wait” in the scene of the main.qml with the gravity.y: scene.gameState != “wait” ? -27 : 0 underneath it, but I am very sure that’s not what you are not supposed to do. I am new to this coding stuff and don’t have much experience yet. I am sure there is a really easy way to do this since the game being made is fairly simple. Any help would be appreciated. Here is the link if you need it: http://v-play.net/doc/howto-flappybird-game/
- This topic was modified 3 years, 4 months ago.