Jump to content

Search the Community

Showing results for tags 'settileindexcallback'.

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

  1. I'm trying to change the velocity of an object with a callback from "setTileIndexCallback" but with no luck. I can read its body velocity but cannot set it. Slug = function (game, x, y) { x *= 16; y *= 16; Phaser.Sprite.call(this, game, x, y, "atlas", "slug/slug-1"); this.animations.add('crawl', Phaser.Animation.generateFrameNames('slug/slug-', 1, 4, '', 0), 10, true); this.animations.play("crawl"); this.anchor.setTo(0.5); game.physics.arcade.enable(this); this.body.setSize(20, 11, 7, 10); this.body.gravity.y = 500; this.body.velocity.x = 40; this.body.bounce.x = 1; globalMap.setTileIndexCallback(3, function(){ console.log(this.body.velocity.x); this.body.velocity.y = -50; }, this); } Slug.prototype = Object.create(Phaser.Sprite.prototype); Slug.prototype.constructor = Slug;
  2. Hello I try create callback function - when exist collision, but in phaser I found only this method: setTileIndexCallback - but this method disables collisions. map.setTileIndexCallback([9,10,11,12], function(){ console.log("callback and collision...?");}) Does anyone have an idea how to create a collision with a tile-map of the callback function?
  3. Hi I am coding a small tilebased-top-down adventuregame. I'm learning Phaser as I go along, and I've discovered the setTileIndexCallback method. map.setTileIndexCallback(tileIndex, callBackFunction, this); It's working like a charm ... except for the fact that I only want it to trigger the callback function when my character enters the tile. It seems as though every Update() triggers the callback function as long as the player and the tile overlap. Is there any way to alter this behavior so it only triggers when the character enters the tile? Kind regards - Jakob
×
×
  • Create New...