Skip to content

v1.0.2

Choose a tag to compare

@Alessio-Marchese Alessio-Marchese released this 27 Nov 11:06
· 10 commits to master since this release

🔧 New Release Update

In this new Release the following things were added to the Engine:

PlayerTag component

A component that it's used to mark one GameObject as Player, it's used by the camera to adjust it's position.


CameraFollowSystem and Camera entity

Camera entity contains the X, Y pos + offset + follow speed, the system update this position based on PlayerTag position + an eventual offsett from it. It's possible to play around with the camera speed, in order to decide how fast the camera should follow the player during the delta time.. if i't high it's going to be istant.


Updated RenderingHandler

i have done 2 updated in this handler:

  1. in order to see the effect of the Camera i updated this system, so now, every sprite draw itself based on the position of the camera, this gives the illusion that the camera is moving around the sprites while instead the sprites are creating themself around based on the camera position.
  2. Sprite rendering layers.. i added inside Sprite a variable to keep track of the layer.. now the rendering is going to render all the sprites based on a Z order, so we can decide which spirte goes on top of others.. in the example i place Background with zIndex = 0 and Player with zIndex = 1.

New tests

i added new Tests for the Rendering update and also for the new Camera system.


Refactor

i refactorized some code, various improvements and cleaning, one of the most important is Tests readability, i added many comments for every test in order to make those easier to read.

Sandbox video for POC:

Sandbox2.mp4

Asset Credits
Pixel PNGs by Vecteezy