Jump to content


  • Content Count

  • Joined

  • Last visited

About askariwa

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

1004 profile views
  1. Great work Hexus, i really like the sprite scale support, btw i think you meant May (not June 2017). Any thought about what you're thinking to add to the v0.3.0 ?
  2. Could anyone tell me why the p2 physics example don't collide with world bounds ? I have tried to add game.world.setBounds(0, 0, 1600, 1200) before game.physics.startSystem(Phaser.Physics.P2JS) but moving the player to the left keeps moving him out of the screen. :-( Updated : i had to add instead game.physics.p2.setBoundsToWorld(true, true, true, true, false); after "placing" the player sprite just as the example here http://phaser.io/examples/v2/p2-physics/tilemap :)
  3. Thank you for your suggestion VitaZheltyakov, i saw that i had to modify the update function by adding this (the second line keeps the body centered on the sprite) sprite.body.setCircle(45*sprite.scale.x); sprite.anchor.set(0.5*(sprite.scale.x/2));
  4. I tried to modify the Arcade physics Body scale example online this way : game.load.image('wizball', 'assets/sprites/wizball.png'); modifying the sprite in the create function like this: //sprite = game.add.sprite(200, 300, 'gameboy', 2); sprite = game.add.sprite(200, 300, 'wizball', 2); then adding this line after game.physics.enable : sprite.body.setCircle(45); and finally activating the debug in the render function game.debug.body(sprite); Why the circle body does not scale ? The only thing that scales is the sprite.
  5. Hi,what do you mean by "certain location" ? if the coordinates are given in tile values then you have to get the tile using the getTile method, if they are in pixel values then use the getTileWorldXY method. After getting the tile, you can read its index property to get its type or its properties public property to get its "properties" (defined in Tiled) See this example for tile properties.
  6. Ok, it was my fault My map had too many layers and i was expecting results from the wrong layer. I should have tried to use a simple tilemap with just one level because getTileWorldXY works as advertised
  7. Hi, i am trying to get the type of a tile once clicked on but i get inconsistent results, i have made an example of my case here : http://jsfiddle.net/fkossyvas/7Lybhpda/ The code which displays the type is this one : this.currentTile = this.map.getTileWorldXY(pointer.worldX,pointer.worldY,32,32,this.layer); this.text1="pointer.worldX:"+pointer.worldX; this.text2="pointer.worldX:"+pointer.worldX; this.text3="currentTile index:"+this.currentTile.index; Any help ? Thank you
  8. I was using explosionsCollisionGroup after the code i've posted (i didn't wanted to make a long post) that's why but i just didn't saw missing the increment during the loop ! I am going to study your example, which seems to be exactly what i was trying to do. Thank you for sharing this stvrbbns and for your help
  9. I have finally defined the collision groups as i had to, at least i think var ship; var map; var layer; var cursors; var result; var tilesCollisionGroup; var shipCollisionGroup; var explosionsCollisionGroup; function create() { game.physics.startSystem(Phaser.Physics.P2JS); tilesCollisionGroup = game.physics.p2.createCollisionGroup(); shipCollisionGroup = game.physics.p2.createCollisionGroup(); explosionsCollisionGroup = game.physics.p2.createCollisionGroup(); ship = game.add.sprite(200, 200, 'ship'); game.physics.p2.enable([ship],true); ship.body.clearSh
  10. I am trying to modify the p2.js example (http://phaser.io/examples/v2/p2-physics/tilemap). I have added a group named explosions which i want to have it's members to collide with the ship but not with the tilemap. From what i've read in the forum, i need to use the collision groups but i cannot understand how (in this case). Using them for the ship is easy and think that using a loop could be ok for the explosions group but for the tilemap it's not that easy. I have read nearly all posts in this forum but i didn't find anything for this case. Any hint ? function preload() {
  11. Thank you very much for your answer (and the good news ). I'll go to study the example right away.
  12. Is it possible to apply a shader (filter) to a spr├Čte, get the resulting image and "send it again to the shader" , ie apply the filter to the new image ? I have already asked this question at the Phaser forum (here) but i have got no answer, maybe it can't be done ?
  13. It's fine for me too, Chrome on Android.
  • Create New...