0
\$\begingroup\$

I'm trying to build an '90s style rpg game, think dragon warrior series, where it will have a UI box at the bottom of the screen where the user makes a choice like attack, move, eat etc

I'm thinking of having a game controller (phaser scene?) which updates a board scene and a UI box scene and displays other scenes if necessary

I am thinking of passing in to the UI box an object with message, an array of choices and each choice will have a callback method

So as far as I can tell there are three ways to pass event information to a scene

1) use get scene method to get an instance of a scene and then make calls to that scenes methods

2) using event emitter

3) stopping and starting a scene and passing parameters into the create method

Is one way preferable or another? is there a good coding standard? Would anyone be able to offer any other helpful hints on how to accomplish the above task

\$\endgroup\$
3
  • \$\begingroup\$ These options all sound like they'd work. What have you tried so far? Did you get stuck anywhere, or are you unsatisfied with the result of any particular aspect? There's rarely one "correct" way to do things in games, so if your solution works, that's generally enough. \$\endgroup\$ Commented Mar 29, 2020 at 16:33
  • \$\begingroup\$ I saw in another example a create and destroyed, option number 3, I was just worried about memory management by creating and destroying the object over and over again but it seemed like that would work. I am also thinking of the game manager holding an instance of every scene the board, the UI, player creation scene, but have been reluctant to try anything yet because I don't want to redo everything. Trying to learn and adhere to best programming practices \$\endgroup\$ Commented Mar 29, 2020 at 16:51
  • 1
    \$\begingroup\$ Fear of redoing work can paralyze you, and hurt your development much more than the refactoring itself. Take the risk, try stuff, and measure whether it's accomplishing what you need. If it is, great! If it isn't, you'll have learned more about your tools and problem space that will inform all your future work. \$\endgroup\$ Commented Mar 29, 2020 at 16:52

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.