K
K
Konstantin2022-02-09 16:59:33
pygame
Konstantin, 2022-02-09 16:59:33

How to solve the problem with the installation of blocks in the game?

I'm making a 2D game with camera movement.

At first, when I did not have such a "camera", the blocks were placed according to the following principle: mouse_coordinates//64*64.

And now everything works like this:
1. There is a pygame.Surface (let's call it gameSurface) and everything on the map is located on it.
2. When the player moves to the left, the entire gameSurface moves to the right, and so on.

But after adding the camera, the blocks are placed in the same way as if the whole map is in one place.
To make it clear where to change what, I will leave a link to GitHub: https://github.com/FireFall-YT/ShootBox

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question