frozenthrone

Members
  • Content Count

    3
  • Joined

  • Last visited

About frozenthrone

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  1. I want to touch a sprite hold it and drag it to a new point and then release it. How do I implement this? I tried the following code. sprite.inputEnabled = true;sprite.input.start(0, true);sprite.input.enableDrag(false, true, true);It is working perfectly using mouse on desktop but on mobile, first i have to touch the sprite then touch on another position to move the sprite there(No dragging and dropping is done here). I want to touch the sprite to pick it up and without releasing I want to drag and move it to a new position. Please help. Thanks
  2. Thank you rich for your reply. I find that there is no overlap detection function for p2 bodies just like we have in Arcade. Is there any solution to find just if the rects overlap?
  3. I am a newbie to game dev and Phaser. My scenario is this. I have a rectangular sprite(Initial angle 0 degrees) that rotates about its base. There is another rectangular sprite below it which gets overlapped by the rotating sprite at each rotation. Collision without rotation works for me. But I am unable to detect the collision when the first sprite rotates. Please help me sort this issue. I use arcade physics. My code is below. function create() { sprite1 = game.add.sprite(100, 100, "sprite1"); sprite1 = game.add.sprite(100, 150, "sprite1"); game.physics.enable(sprite1, Phaser.Physics.ARCADE); game.physics.enable(sprite2, Phaser.Physics.ARCADE); }function update() { sprite1.angle += 1; game.physics.arcade.collide(sprite1, sprite2, collisionHandler, null, this);}function collisionHandler(obj1, obj2){ console.log("Collided");}