Is the good approach to create a game with only one state?


#1

I just want to follow a Abstract factory design pattern to create a game for that i have extended the phaser.state for single class called GameState. In that GameState i have created a object for boot,load and main class.
unctionalities of class
Boot - boot the physics
Load - load the game assets
main- Game play mechanism


#2

Yes that works fine, I used this approach for most of my games. However if your game is medium-high complex or you have many states, it would be best to add more States/Scenes (v3) and separate the logic.

If anything that single class will become very long and you will face problems finding stuff in it. Also consider that it would be a nightmare to edit afterwards if you want to extend your game further.

TL;DR; Its fine as long as your game is small ( for example 1 platform level), but consider splitting up if it is more complex.