Day 3
Being very low res, the screen estate is very tiny. For readability, everything is as big as it can. The consequence is that the screen gets very crowded and the movements are restricted. One thing that would happen was the conglomerating of multiple moons adding up their gravity.
I wanted to add a Pac-Man-like screen teleport effect.
I learned, thanks to my mentor, that colliders have a bounds Class with some useful properties to get the position of the bounds in all the axis of a Collider.
The script looks for everything exiting the Collider2D and checks if it's out of bounds, based on what bounds it exit from I invert the coordinate. The script looks like this (simplified):
private void OnTriggerExit2D(Collider2D collision) { if(collision.transform.position.x < borders.min.x) { newPosition.x = borders.max.x; } collision.transform.position = newPosition; }
I had some problems with the moons having erratic movements after teleporting that I solved by disabling the PointEffector2D component before the teleportation.
I had a problem with the trail renderer becoming long as the window after teleportation. The last point of the "tail" remains in the last place on the other side of the screen. There's a method CLear() in the TrailRenderer but it didn't work; maybe it needs some frames to affect the component but I didn't have enough time to try some iterations, so I disable the component before teleportation. If you have a better solution please leave a comment!
I added a blackhole animated with a scale and rotation effect, added some emitting particles to give the idea of a gravity effect, and made it follow a path with a tool I recently learned to use. It's a free asset on the asset store called BGCurve. which makes it easier to create splines and paths with some animations. Give it a look! It's very modular and adaptable for a lot of different use-cases.
Lastly, I improved the presentation. I added a new background made with Aseprite, added some copyright free music, and UI SFX. It's a joy to play a more refined game :)
Next up
Making the black hole part of the level design, making it an opponent and objective of the game. Clear some scripts and polish the presentation. I want to start with the game design of the game but I'm waiting to have a more complete and polished experience, though tomorrow I will start sketching some ideas for the objective of the game and some levels.
Leave a comment
Log in with itch.io to leave a comment.