Search the Community

Showing results for tags 'parameter'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

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 3 results

  1. I have this code: scene.physics.add.overlap(spears.children.entries[numberOfSpearThrowerMachines], platforms, stopSpear, null, this); function stopSpear(number) { spears.children.entries[number].setVelocityX(0); } I am trying to send a parameter to the function stopSpear when calling it. Like this: scene.physics.add.overlap(spears.children.entries[numberOfSpearThrowerMachines], platforms, stopSpear(numberOfSpearThrowerMachines), null, this); but this does not work obviously, so how do I do it instead?
  2. (I'd consider myself still a beginner despite dabbling with JS in the past, as some of the concepts I can't seem to comprehend or remember.) I'm working with pre-built puzzle game code, much of which I can understand, but I noticed that the author included a parameter ("game") in each of the state functions (located in separate JS files, like Boot.js), and I'm not sure what the purpose of it is. BasicGame.Boot = function (game) {};BasicGame.Boot.prototype = {...};In retrospect it probably doesn't make sense, but originally I thought that was a way to pass the "game" var in var game = new Phaser.Game ...to the other states, but I guess besides being a local var, since the "game" in function (game) is a parameter, it can be called whatever and still work. Furthermore, deleting the parameter doesn't affect the game apparently, so I'm wondering if the inclusion of it was just something the author forgot to delete or something like that. If someone could just help me understand what the purpose of "game" is or could be, I'd appreciate it. Let me know if more info is needed, and thanks. index.html: <script type="text/javascript">window.onload = function() {...var game = new Phaser.Game(825, 625, Phaser.CANVAS, 'gameContainer');...game.state.add('Boot', BasicGame.Boot);...game.state.start('Boot');};</script>Boot.js: var BasicGame = {};BasicGame.Boot = function (game) {};BasicGame.Boot.prototype = {...};
  3. Hi there, I'm trying to do something which I think should be rather simple but I don't seem to be able to achieve it. When a button is clicked, I'm trying to pass a parameter to the button callback function, however if I pass anything to the function and console.log it out, it's always the clicked button. Is there a way to pass a parameter other than the button to the button callback? Thanks! Martin