SFML community forums
Help => General => Topic started by: GamDev on January 27, 2019, 09:49:20 pm
-
Hi, please tell me what is the best way to render large game map
to get such a result? Attach 1
(https://i84.fastpic.ru/thumb/2019/0127/14/af88b423de70c38d602588d53cb3b214.jpeg) (https://fastpic.ru/view/84/2019/0127/af88b423de70c38d602588d53cb3b214.png.html)
i have 48 blob sprites (8-bit masking)
like this: Attach 2
(https://i84.fastpic.ru/thumb/2019/0127/4f/9c57ca158bc2018a45c384bb46d6ae4f.jpeg) (https://fastpic.ru/view/84/2019/0127/9c57ca158bc2018a45c384bb46d6ae4f.png.html)
My problem is: Attach 3
i render my map in VertexArray, but VertexArray can not mix two sprites together, like this:
(https://i106.fastpic.ru/thumb/2019/0127/50/fc595972b8b6c48c7be4f1b876a01b50.jpeg) (https://fastpic.ru/view/106/2019/0127/fc595972b8b6c48c7be4f1b876a01b50.png.html)
How can I draw a game map so that the sprite overlay on top of another sprite?
-
like this:
?
-
A vertex array allows you to draw any shapes at any position you want. That also means, that you can draw two quads on top of each other. It makes things harder to reason about, but is certainly possible.
Alternatively, it might be easier to just create the overlay tiles in an image editor and use that as new tile type.
-
create the overlay tiles
game map is randomly generated.
i use 48 blob sprites
-
That also means, that you can draw two quads on top of each other.
How to draw two quads in one position ?
-
Give 2 quads the same position/coordinates.