Player in the middle of the screen when he walks
-
@richard It doesn't work either. I have the feeling that setSpriteCamera moves your sprites instead of moving itself. It is a bit weird. I don't know if someone else think the same.
-
-
If you want different targets for the camera I'd set up a variable and key which one you want it to follow. Wouldn't that work?
-
If followP == 0 then
Setspritecamera(p1.x,p1.y,1)
endif
So on -
The problem is that the camera doesn't follow the target but it moves the map so every sprite drawn moves along the camera :(
-
If setspritecamera() moves the map, then why not always draw the player at the same coordinates but still update player.x and player.y to update the camera. This may be the totally wrong way of looking at it but it could be a step in the right direction.
-
Yeah, I'm drawing the current player at the centre of the screen and using player.x and player.y to update the camera. The problem comes when I try to draw the rest of sprites, if the camera moves, they all do. I need some kind of camera function that only moves the camera.
Edit: CentreSpriteCamera works fine when using DrawSprites, but in my project I have tiled images that need DrawSheet function to be drawn. Using CentreSpriteCamera along with DrawSheet produce the following wrong behaviour:
-
@Skullo you can use set sprite image in a very similar way to draw sheet.
setSpriteImage(handle, imageHandle, tileNumber)
If you used sprites in this way, you could still use your state machine for the specific tile you wanted to show and they would work with the sprite camera along with your map.
-
@richard It works! Thank you very much everyone for your help!!!
-