Jump to content

Search the Community

Showing results for tags 'scenes'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 19 results

  1. Right now, my main game has 2 scenes: The main game A score counter HUD at the top I am trying to create a Game Over screen with a Play Again button, where once the button is pressed, the score is reset and the main game is reloaded. Currently I am doing this: this.play_again_button.on('pointerdown', () => { console.log('Play again button has been clicked'); this.scene.stop(); this.scene.launch('Game'); this.scene.launch('Score'); }); Where basically, the current "Game Over" screen is stopped, and the 2 scenes for the main game mentioned above
  2. 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
  3. Hi everyone. I'm trying to implement a pause option in my game. I have two scenes, the scene where the game is being played and the scene when it's telling you that the game is paused. From the playGame scene I have this code to move to the paused scene goToPaused(){ this.scene.pause(); this.scene.start('paused'); } This works as intended. The playGame scene is paused and it starts the paused scene. Now, from my paused scene I have this code to resume the playGame scene and stop the paused scene. resumeGame(){ this.scene.stop(); this.scene.resume('playGame'
  4. //Here is a template for scenes in Phaser3. //This can be used to ease the development of Phaser 3 games. New scenes can be added in a similar manner and existing scenes can be removed easily. //For any changes in the number of scenes do not forget to make appropriate changes in the scene:[ ] in the config settings at the end of the code. //Each scene is labelled with corresponding scene number. //The scenes can be switched to the next scene using the next button. //The main menu button can bring you back to GameScene1 from any other page. //Each Gamescene has 4 functi
  5. In my game the player will create a character (TODO), then start the game. The game starts by placing one tile on the board Right now I just have a GameController which is a phaser Scene In the Game Controller I want to have instances to the board and the UI Menu so that I can communicate with the other scenes throughout the game The issue that I am currently having (and I think that it is because of JS single threaded nature) is that I need to wait for the Board's create method is complete before I can start calling the other methods, but scene.run does not start until Game.
  6. My scenes with the maps I created are not loading in the browser. To get an overview of what is going on, I am creating a game RPG like game that that has a top down view of the character. The game I am making requires the character go into a store and buy some items. I think I may have found a solution for the problem of switching between maps using multiple scenes. However, the problem now is that the map isn't loading and when inspect the game in chrome an error message that reads "Uncaught Reference Error: SceneA not define at index.js: 19". I thought that I set up the code correctly.
  7. Hello Guys! First of all, this is my first topic! I've read some of your questions and answers, and most of them have helped me a lot with Phaser 2 to 3 update. Thanks a lot for all the hard work. But, I have some questions. Right now I'm updating one of my games from Phaser 2 to Phaser 3, and wow its a lot of classes updates. and logic changes. But I need a suggestion in one of them. In Phaser 2, I extended the Phaser.Game class to save some data on it (most of it its configuration data), and I could access it from ANYWHERE in my classes and states. Now in Phaser 3, with the sc
  8. I am having some problems with my sprite animations as I move between scenes. Each scene ran ok until I returned to it On my first playthrough, when i returned to the scene i was informed, via console.log, that the various animations' keys "were undefined or already in use" (so after using the github docs (....docs/animations_AnimationManager.js.html) I added the if config.key || this.anims.has(key) check. However it does not play and my console.log now outputs the following RED ERROR: Uncaught TypeError: Cannot read property 'getFirstTick' of null at initialize.p
  9. Hi all, I'm trying to build a demo keeping it simple with ES5, and I'm trying to add a custom method to a scene, in a way similar to how it was done on Phaser 2. I realized this is not possible and was wondering if there is any recommended way to do this (without using ES6 to extend the Scene class, and without adding functions in the global scope either): var GameScene = { preload: ... create: ... update: function() { // custom logic if(...) { // if something happens, game over (doesn't work). this.gameOver is undefined this.time.delayedCall(
  10. I was wondering if it's expected behavior that camera effects are not reset when a scene is restarted. The following code will fade out, and the screen will remain black after the scene is restarted: gameScene.create = function() { // create a sprite let bg = this.add.sprite(100, 100, 'treasure'); // fade out this.cameras.main.fade(1000); // restart the scene this.time.delayedCall(2000, function() { this.scene.restart(); }, [], this); What I'm adding at the moment is `this.cameras.main.resetFX();` when initiating a scene in order to have the view back, b
  11. Hi all, I'm trying to restart a scene but as you can see in this video, rebooting a scene doesn't get rid of the sprites of the scene: I was wondering if I'm making a mistake on how I'm restarting the scene, or if this is a bug and I should open a Github issue. Any help would be much appreciated!
  12. I'm trying to get my head around the scene life-cycle and main methods. I understand render is called (aims at) 60 fps. What's the frequency/time-step of update?
  13. I've read through just about all of this guide (https://github.com/kittykatattack/learningPixi). I think I have a grasp of how to switch stages/scenes. There's one part that doesn't make sense to me however. If I wanted to create a separate .js file for every class and every scene's code, what's the best practice for loading those files? I've seen examples where the index.html file just includes all of the scripts, but isn't that possibly a slow and/or bad experience? A previous flow I read about was loading the bare minimum (a background, logo, and loading graphic) and then loading all
  14. Hi there! I'm relatively new...ok very new to coding with phaser and I'm having a tough time finding tutorials that can help guide me through a few of the basics for what I'm looking for. I've been trying to use this tutorial: How to make a multiplayer online game with Phaser, Socket.io and Node.js And this one: How to create a multiplayer game with Phaser, Node, Socket.io and Express. However, it seems that both tutorials were made using Phaser2 and there are a few fundamental differences that don't function well using the newer code. The biggest part I'm havin
  15. Hello, I have a script due tomorrow morning, and have asked a question on a seperate post which is the ideal solution. The only other solution I could show have for tomorrow is to start the renderloop, load an OBJ, and then dispose of the scene - but then the scene needs to begin loading new meshes after it detects a new path and mesh in an array, and render without any client interaction. I can't figure out how to load several scenes - lets say 5 scenes - and load scene 1 for 30 seconds, destroy scene one, on destroy scene two loads on it's own, and this process continues until scen
  16. Hey guys, Just wanted to show my little in-development game engine. I decided to create my own engine as Panda.js didn't got any updates for several months. The goal here is to have a lightweight but powerfull game engine with awesome performances, whatever the device is (ie. Android) while being able to use Canvas+ (so, no DOM is used as Canvas+ doesn't supports DOM). What I've already done: Game config via `config.js` file ; Game scenes ; Ultra-customizable Sprite class that allows to modify everything drawing related ; Mouse events support (click, move, hov
  17. Hi Folks, iI try to syncronize my 3D Animation with a music track. How I can do it? Thanx
  18. With the first days of July! Please tell me the answers to a couple of things: 1. How to make so that when you double-click on any player object transferred from one stage to the stage 2? In other words - how to do that at an event on the gaming facility dblclick a change of scene. 2. How to do that when you click the player's character was directed to the object (the gate) and in their achievement of a change of scene (location).
  19. Hello, how is it going? I have trouble understanding how game states works in Phaser, I've searched the forum and I found a few posts about this, but I don't understand exactly how should I use it, I found it a bit confusing. ^^; I know the basics, but I don't know how to implement it. I mean, I have two files in HTML format, one is the menu and the other one the game itself. Should I write all the code in one document or just leave it like is right now? Thank you so much in advance. Regards, Daniel.
  • Create New...