Jump to content

Search the Community

Showing results for tags 'game states'.

  • 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 12 results

  1. Hello there, I have 3 files for a phaser game an html, cs and javascript file(excluding phaser.js). I would really appreciate if someone who understands the this.blank format would help me convert to a game where I have a boot state, menu state and play state of the game. I honestly don't know how to do this, this would help me learn more and also help progress me a bit because I haven't been able to successfully transit into this.blank format although I have been given examples which I would say are way more complicated than my game and those examples were missing some parts that would have h
  2. My current project uses game states, and I'm to the point where I have a character that can walk between different levels (states), but in every js file where my individual levels are I have all my code for player movement duplicated in each. I'd like to make my code slimmer and more modular because I'm to the point where I'm getting some slow down/lag in chrome browsers, and I'd like to keep scaling my project and that isn't easy with all of this duplicate code in every state. For reference, the way my project is constructed is based off of this tutorial: http://www.emanueleferonato.com/
  3. When running in a game state, executed from an Angular controller and canvas, is it possible to end the game by routing to another angular context. I tried using $location.path("/angular-route") but $location is not defined in the game state. I've got the usual booter, preloader, and game states set up and the problem occurs in the game state. Thanks
  4. Hi all, I'm trying to get a handle on using states correctly. I'm creating a fishing game, which has an over-world you walk around in, and can approach different bodies of water. Once you get near one you can press space to fish. I then start a new state, which will be a mini-game where you try to catch the fish. Then I want to return to the over-world with a successful (or not) catch. Right now, I can start the mini-game phase (miniGame.js), passing in the fish to catch, but when I return to the overworld (Game.js), I can't display the fish or add it to the inventory, because I'm tr
  5. Hello, I would like to use game states in my project. I followed this tutorial http://perplexingtech.weebly.com/game-dev-blog/using-states-in-phaserjs-javascript-game-developement. In my project I get the error "Reference error: menuState is not defined". You can download my code in the attachment. Can anybody help me with my problem? I am a beginner, so can you please tell me a solution in an easy way? Thanks! Week 6 - Menu game.zip
  6. I would like to prevent players from switching to any game state by typing "game.state.start('name');" into the console. Has anyone found a way to prevent this from happening? Imagine you have a login-screen and any user can just type "game.state.start('play');" into the console and skip straight into the game. I have already tried using anonymous functions and closures but the problem is that the other states such as BootState, MenuState, GameState etc cannot access the game object created from new Phaser.game. I cannot be the only one who's worried that users can simply skip any game st
  7. Trying to understand state handling in Phaser. In this simple example, why does the following code log "Menu State" followed by "Game state" in the console? I would expect it to only write "Menu state", since I have not switched states anywhere in the code. var game; game = new Phaser.Game(800, 600); game.state.add("Menu", state_menu); game.state.add("Game", state_game); game.state.start("Menu"); function state_menu() { console.log("Menu state"); this.update = function () { } } function state_game() { console.log("Game state"); this.update = function () {
  8. Hello, I've been working on a game for 2 weeks. In this game, there will be several maps / levels (2 atm). I want the player to be able to go from one map to another, and back to the first map again. I'm using one game state for each map with a create function that creates every game object the map needs. So basically it recreates everything when I go back to a map I already visited, and it feels so WRONG ! Do you have any idea on how to improve this ? Is there a way to 'freeze' a state when I change map, and 'unfreeze' it when I go back to it ? Or should I merge those in o
  9. Hi, I am creating a game which is using a dynamic map generation including several separated areas. Each area will have its own specific logic and events. So i was planning to deal with that using states but i am not sure how to structure it since there will be like 30 area type. Any suggestions? thx in advance
  10. Hi, another question about performance~ I've been busy updating my code to get more performance out of Phaser and CocoonJS. Currently everything runs fine ( stable 55 - 60fps ). Question / Problem When I change States - for example I go from my titlescreen into the mainmenu State: there are a few sprites set up and a few tweenings are done. A few means 3 - 6. During the change into the state the game struggles a little bit - it is lagging and also the tweening is lagging. This happens on all iOS devices (only developing for iOS included normal resolution screens / retina devices / iPad Air).
  11. I have seen game states being constructed in a few different ways: // the game object is an argument of the constructor, and also property of the statevar state1 = function(game){ this.preload = function(){ this.game.load.image('img1', 'assets/img1.png'); ... } ...};// the state appears to be synonymous with the game objectvar state2 = function(){ this.preload = function(){ this.load.image('img1', 'assets/img1.png'); ... } ...};Both appear to work, though I don't understand why. Could someone enlighten me? Also, are there recommendations as t
  12. So, I just started using different states in Phaser to handle the use of Win screens and the like. The problem that I'm having, is that the update function doesn't seem to be recognizing the this.hero at all. It doesn't stop the animation or the hero's velocity when it hits the ground. Similarly the updateCounter function doesn't seem to be running at all. I usually declare my functions as such: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, updateTimer: updateTimer});function preload() {} and both the updateTimer and the stopping ani
  • Create New...