Jump to content


  • Content Count

  • Joined

  • Last visited

About DudeshootMankill

  • Rank
    Advanced Member

Recent Profile Visitors

1009 profile views
  1. I figured this out on my own. What i did was this: this.physics.arcade.overlap(this.bullets, this._collision_layer, function (bullet, _collision_layer) { bullet.kill(); }, function (particle, _collision_layer) { return _collision_layer.collides; }, this); Following this article https://github.com/hexus/phaser-arcade-slopes/issues/7
  2. Hey guys, i'm making a sidescroller with phaser and tiled. I've run into some problems with the gun function. I collide my bullet group like this. this.game.physics.arcade.collide(this.bullet, this._collision_layer, this._kill_bullet, null, this); and the function goes like this: _kill_bullet(bullet, _collision_layer) { bullet.kill(); } this._collision_layer is a tilemap. Now the bullets collide and destroy pretty well, when fired at a low rate of fire. But when i ramp out the speed and rate of fire, the bullets start passing through the collision layer.
  3. Heya, i'm making a sidescroller with ladders. When the player is over a ladder, which is a seperate layer this runs: this._map.setTileIndexCallback([33, 43, 51, 61], this.player.setOnLadder, this.player, this._ladder_layer); I use this to call the ladderfunction, disabling gravity. It works just fine. My question is, can i resize the bounding box that calls the setTileIndexCallback? The tiles are 64x64, and i need the player to be in the middle of the sprite before setOnLadder is fired. Could i resize the bounding box so its something like x = 4 and y = 64? Or if you
  4. I've got this overlap callback working, so when my sprite overlaps with the ladder it returns the ladderMode fuction. Like such: this.map.setTileIndexCallback([33, 43, 51, 61], this.ladderMode, this, this.ladderLayer); Is it possible to make this a true or false callback? So that when i'm overlapping and this.ladderMode occurs it just returns for example ladderStatus = true; and then when there's no overlap ladderStatus reverts to false? i need it for this: update: function () { if(ladderStatus) { gravity = 0; } else { gravity = 130;
  5. If a moderator could destroy this thread it'd be nice.
  6. Disregard this. this.map.setCollisionBetween(0, 10000, true, this.ladderLayer); this.map.setCollisionBetween(0, 10000, true, this.collisionLayer); I did this and it worked.
  7. Hey guys i've got a weird problem with tilemaps. In the create function i've got this: this.collisionLayer = this.map.createLayer('CollisionLayer'); this.ladderLayer = this.map.createLayer('LadderLayer'); this.collisionLayer.resizeWorld(); this.map.setCollisionByExclusion([0 ]); and in the update function: this.game.physics.arcade.collide(this.player, this.collisionLayer); this works just fine, and the player collides with the collisionLayer and so on. However if i do this: this.game.physics.arcade.collide(this.player, this.ladderLayer); Noth
  8. Sorry for raising a dead horse from the grave here, but i'm having major troubles with this solution when using a gamestates. function yourClickFunction(sprite, pointer) { sprite.alpha = 0.5; } i would have to use this. here (this.sprite, this.pointer) . But that throws up an error. Thank you for your time.
  9. Thank you friend. All of this worked out perfectly.
  10. And another question, if you have the time In your second example how would i combine this.animationPass(); and setInterval? I've got this snip here introMap.prototype = { create: function () { myInterval = setInterval(this.animationPass, 1000); }, update: function () {}, animationPass: function () { this.introText = this.add.text(320, 240, 'Write some text'); this.introText.addColor("#E0AF33", 0); this.timer++; console.log(timer); } } When i do this introText = cannot read text of
  11. A whole bunch of thanks to you. This worked perfectly . Is there some reading you would recommend that elaborates on this?
  12. Hay guys, trying to learn states and i've run into a problem. I've got this function. And when it is called, i need it to create some text. States and breaking my phaser game into several files is a first for me and i cant for the life of me figure this out. I need to create some text from the animationPass function, but i get this error: Uncaught TypeError: Cannot read property 'text' of undefined -- of line 7, and thats where the create introText line is. in my intro.js i've got function animationPass() { introText = this.add.text(320, 240, 'Write some
  13. Well, i've hit another snag. I've given my player sprite a child, this is the gun and it tracks the mouse. Now if i turn left, and use scale.x -1 to flip the sprite the gun gets inverted aswell. I've got this so far if (cursorPos > 140) { arrow.rotation = game.physics.arcade.angleToPointer(player) - Math.PI; }; The gun is aimed to the left side but the rotation is inverted of the mouse position. Hope anyone could point me in the right way again?
  • Create New...