Jump to content

Search the Community

Showing results for tags 'lambda'.

  • 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. I have problem with timer - I want a repeated execution of a function, which works if the function is lambda, but not if the function has a name. For illustration, this code writes the console every second: game.module('game.main') .body(function() { SceneGame = game.Scene.extend({ init: function() { this.addTimer(1000, function() { console.log('second'); }, true); } }); game.start(); });This code writes the console exactly once, after a second: game.module('game.main') .body(function() { SceneGame = game.Scene.extend({ init: function() { this.addTimer(1000, this.my_timer(), true); }, my_timer: function() { console.log('second'); } }); game.start(); });In my understanding they should be equal, but I have subpar knowledge of JS, so maybe it's some scoping thing?
×
×
  • Create New...