EyeKyu Posted December 3, 2013 Share Posted December 3, 2013 Hi, so I'm new to Phaser and I've been trying to make a little game, I want the movement of the player something like the tank game, with the camera following except instead of using the arrows I'd like to use the touch/mouse input.The input coordinates I'm getting back are relative to the canvas is there anyway to get this relative to the world instead. Any help would be brilliant, I've tried a few different things but I can't seem to find a way around or any examples or existing games that do this. Also, what is the purpose of the game.camera.deadzone in the tank game? Link to comment Share on other sites More sharing options...
rich Posted December 3, 2013 Share Posted December 3, 2013 You probably want:game.input.worldXgame.input.worldYThe deadzone is a rectangle inside of which the sprite doesn't cause the camera to scroll. When it hits the edge of the rectangle the camera will scroll, so you can resize this to create different sorts of effects, for example in a scrolling platform game you almost certainly don't want to only scroll the camera when the player hits the edge of the screen, so you'd make the deadzone smaller to accommodate. Link to comment Share on other sites More sharing options...
EyeKyu Posted December 3, 2013 Author Share Posted December 3, 2013 Works like a dream, thanks a million for getting back to me so quick too, my day has been made Link to comment Share on other sites More sharing options...
Recommended Posts