Jump to content

Phaser, replace text with user input?


PizzaPie773
 Share

Recommended Posts

Hello, my class and I have recently started phaser, we are using the farm animal game from zenva to make a new game with the same mechanics. The game me and my partner are making is a guessing game, but I am having some trouble figuring out how to make our buttons work. What I had planned to have is where a player could pick a button and it would replace text with a message saying if they are right or wrong. I am not sure where to start, please help thank you.

Link to comment
Share on other sites

You'll want these things:

Image/Sprite for the buttons...
Image/Sprite input enabled to make the button clickable...
Image/Sprite.events to find the interaction you want, and what the callback will receive...
Phaser.Text for the text to tell them if they are right or wrong.

For the answers part, you will need something to track your questions and assign an answer to each button...
When the button is pressed, check the answer that you assigned it in the callback to see if they are correct, and adjust the text accordingly...

 

Without writing it for you, that should be enough to get you going... The docs are very helpful...
 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...