Jump to content

Search the Community

Showing results for tags 'startgame'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello, I have trouble finding out how to make the start menu work together with the game. in the create() function I have this: function create() { var bg = game.add.sprite(game.world.centerX, game.world.centerY, "startBg"); var image = game.add.sprite(600, 300, "startButton"); bg.anchor.set(0.5); image.anchor.set(0.5); image.inputEnabled = true text = game.add.text(250, 16, "", {fill: "#ffffff"}); image.events.onInputDown.add(listener, this); game.world.setBounds(0, 0, 1400, 600); game.stage.backgroundColor = '#182d3b'; game.physics.startSystem(Phaser.Physics.ARCADE); //game.add.sprite(0,0) //Background platforms = game.add.group(); platforms.enableBody = true; var ground = platforms.create(0,game.world.height-64,"ground"); ground.scale.setTo(1,1); ground.body.immovable = true; var ledge = platforms.create(300, 80, "ground"); ledge.body.immovable = true; var ledge2 = platforms.create(-100, 250, "ground"); ledge2.body.immovable = true; player = game.add.sprite(64, 64, "character"); ai = game.add.image(100,100, "ghost"); player.anchor.setTo(0.5, 0.5); game.camera.follow(player); game.physics.arcade.enable(player); player.body.gravity.y = 400; player.body.collideWorldBounds = true; //player.body.bounce.y = 0.2; player.animations.add("right",[11,12,13,14,15,16,17,18,20], 20, true); player.animations.add("left",[0,1,2,3,4,5,6,7,8,9], 20, true); cursors = game.input.keyboard.createCursorKeys(); } I made a large gap so it's easier to see what's the start menu and what's the game, start menu is on top. The thing is I need this image.events.onInputDown.add(listener, this); to make what's on the bottom. I made a function named listener that created the game when i clicked on the button. That worked, but only issue then was that the Update function that makes me able to move the character stopped working. as the update won't run over and over when I don't have the game code in the create function, it just run once and stops. How do I get these two to be more cooperative with each other ? so far I've only been able to either have one or the other.
×
×
  • Create New...