Original Post
Hey, I've started learning about state machines, as I'm sure some of you are aware but I've hit a bit of iffy ground. I'm making a Pong game, but the state manager itself is just part of my generic engine so I'm kind of going for the best all round solution. Anyway, the problem... ----------------------------- I have a state "game" that generally updates the game (which is pong :P) and I have another state called "score" that happens when either the player or ai score. The problem is once a player has scored, the ball needs to be reset. I thought it would be best to do this in the score state but someone suggested that I create a seperate "ResetArena" state, which I think is an even better idea. Both of my ideas here require that the states access the ball. The ball is currently just a variable of the "game" state (which I'm sure is not such a good idea, after doing this :P). So what I need is some kind of way to access the ball from any state. ----------------------------- I thought about it for a while and I think that the best way would be to create a scene management system so that any state can just do something like SceneManager.FindEntity("Ball"). How have you over come this problem? Is my solution good... and what others are there? Thanks, - aCiD2