Jump to content

Unable to add sprites on mouse click on the same location while using camera in phaser


charchit
 Share

Recommended Posts

I am making a level editor for my platformer game. I add images to screen on the mouse position when clicked. It was going well but when I added a camera which move with arrow keys when I try to add the sprite. It's not added where my mouse clicks and sometime it does not add. In the game I have a scrolling camera and I wan't to use it here also.

this is the image

when i press on the highligted place I can't add the platform. The screen is scrolled already.


 
game.world.setBounds(0, 0, 2000, 600)
background.fixedToCamera = true
if (cursors.right.isDown){
   game.camera.x +=30
}
else if (cursors.left.isDown){
   game.camera.x -= 30
}

my code for camera

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...