CharlesCraft50 13 Posted November 24, 2016 Report 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 . Quote Link to post Share on other sites
kevdude 20 Posted November 26, 2016 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.