Search the Community
Showing results for tags 'switch'.
-
Hi, Does anyone know if a single frame in an animated sprite can be used as a trigger to change scene (Phaser 3)? I have an interface with about 30 images set in an animation loop and would like to be able to click on a particular image to change the scene. The result I would like resembles a JavaScript switch statement. Thanks
-
Hi, for my game I use a simple state order like: Main Menu -> Map screen -> Level 1 -> Map screen -> Level 2 -> and so on That works well Just separate everything in logical chunks. But now I had the Idea of implementing some kind of minigames interrupting the level. And thats the point. If I make a state change, the state is resetted if the minigame itself is a state too. Other version is, that the minigame is just a game packed in a group on top of the current state. but this approach make some trouble too cause of physics side effects. So what I desire: Push a new state, play that state and then pop this state and get the old state right there where it ends before. For me this push/pop approach sound very "correct" and intuitive. Is this possible with phaser somehow? Thanks Tom
-
Hey guys, I have a weird issue. After my game has stayed idle for a while and I am currently using another tab, the game turns black. And the weird thing is that if I switch back to another tab quickly and move back to the game - it fixes itself o_0. Also on android the game does not want to turn back from black. The buttons in the game are clickable, I believe this is render related, but I have no idea what could it be. What could be the reason?
-
I want to store the score in game state to end game state. Example: I am in the playing game state and store the score, then when the game is finished. I switch to end game state. How can I send the score to the end game state? can anyone give me a simple example?
- 8 replies
-
- store score
- state
-
(and 1 more)
Tagged with:
-
Hey guys, I'm having some issues switching between states. In the first run it all works fine, but then when I come back to a state I've already been at, like MainMenu, the design is all messed up. I think it is because not all sprites and stuff are removed when I switch states, that's why I added a this.world.removeAll() in my shutdown function. However that doesn't seem to do anything. Is there another short way to delete everything (except cache) from a state before switching to another state, or does it have to be done manually? I've attached 2 images, one of my MainMenu first time, and one of the MainMenu when I switch back to it (after the Game). Excuse me if it is a silly question, I've just recently started using states.. Thanks, Kevin
-
Hey, I'm trying to get my state to restart itself in phaser 2.0 when a player finishes the game. Currently, it kind of works, except some sprites and text are missing. The way I'm switching back is like this: game.state.start('StartScreen', true, true);But, like I said, it restarts the game with some text and sprites missing. Screenshots: StartScreen Before: StartScreen After: Game screen before: Game screen after: You can see in the game screen that the stars are missing and in the Start screen, all the text is missing. My question is this: Am I doing something wrong or is this a bug? I tried looking in the examples, but there are no examples for states.