CharlesCraft50 Posted November 24, 2016 Share Posted November 24, 2016 I'm having a problem here, I have a big tilemap and the light/sun doesn't follow my pointer/cursor when it reached the game's width, also I have same problem in shadows, and I also want to make the shadow of the player small, like a size of the player. Thanks in advance . Link to comment Share on other sites More sharing options...
kevdude Posted November 26, 2016 Share Posted November 26, 2016 One common problem is that if you don't fix a sprite to the camera object in Phaser, the sprite will be positioned to the coordinates of the world, not the screen. For example, if the pointer is at position 480,360, that is where the sun will be positioned in the world. You need to position the sun relative to the game screen, not the game world. Try adding this line after where you create the sun sprite: sun_sprite.fixedToCamera = true; The same thing should apply to the shadow sprite as well. See this example for more information. Link to comment Share on other sites More sharing options...
Recommended Posts