Hi guys,
Im fairly new to LibGDX, but have some experience with Java. I’ve started creating a LibGDX 2D top-down game, and I’ve been playing around with moving my player.
The player group consists of the actors PlayerActor (the Spaceship), the ExhaustActor(Particle effect), and LaserActor(Used to shoot lasers).
Here is the full class http://pastebin.java-gaming.org/7dd002e712019
My PlayScreen, extending an abstract screen, is where my stage and the camera is.
PlayScreen: http://pastebin.java-gaming.org/dd00e31702914
AbstractScreen: http://pastebin.java-gaming.org/d00e140792415
When I move the Players position, I want the camera to follow him while he stays in the center of the screen.
My problem is Player(group) is displayed offset to the top right, and seems to be able to “move around” in a small box, while it should just be centered in the middle of the screen.
Here is what it looks like (I put the green lines in to demonstrate where the center of the ship should be):
This problem only occurred once I implemented a camera to follow the player.
Any help would be greatly appreciated!