Hello. I’m new to Phaser and game dev, though I do have a fair bit of coding experience outside of games. I’m currently working on my first Phaser project, which is a first-person point-and-click adventure game in the style of Myst. I’ve built a functional prototype in which I can click between a few screens, and I could probably continue this way. However, I’m not confident in the structure of the code. If I’m doing something wrong, I want to fix it early so it doesn’t come back to bite me later in development.
My main concern right now is that the game currently only consists of a single Scene object, and I’m wondering if keeping it this way (or even using a small number of scenes) could be a major problem as the game grows larger. Let me explain:
This game mainly consists of navigating the game “world” by clicking between pre-rendered still screens. Each screen consists of an image and multiple clickable zones (with additional multimedia elements likely being added further down the road). Clicking on a zone will either move the player to a different screen, call a function that otherwise alters the game state, or both.
When changing screens, the image for the current screen is made invisible, and all associated zones are rendered non-interactive, after which the next screen’s image is made visible and the associated zones are made interactive. I keep track of all of this with custom classes. Each screen is represented by a View object, which contains an image as well as an array of ClickZone objects.
I’ve been thinking of instead having every screen be its own scene, but I’m not sure if it would do more harm than good (I’m not terribly familiar yet with how scenes work, so forgive me if any assumptions are way off.). On one hand, It feels like having all these loosely-associated views and zones may be asking for trouble, and a scene would more neatly tie all aspects of a screen together. On the other hand, I’m worried that scenes might not be lightweight enough, and that a scene may be way too bulky a data structure to have a separate one for EVERY screen, since there will be a LOT of different screens in this game (usually one for each cardinal direction for every node on the map). What’s your advice here?
Additionally, is there any other aspect of the design that raises any red flags? Here’s a diagram to better illustrate the structure of the program:
Views and zones are populated from a json data file. cursorPath specifies the custom mouse cursor associated with a particular zone.
Any guidance would be greatly appreciated.