Terrarium
- 2 Devlogs
- 9 Total hours
A site where you can watch creatures interact with each other and influence their environment.
A site where you can watch creatures interact with each other and influence their environment.
Worked on getting the creatures to store mouse movements. The goal of this is that they receive information on clicks, drags, and mouse speed. Originally, the code updated original mouse positions to new mouse positions only when the mouse moved, but this proved to be an issue because when the mouse stopped moving, the speed would stay the same. This was fixed by updating the previous mouse positions to the current mouse positions at the end of the mouse speed functions. This means that whenever the function checks again, it will see that the mouse position is the same as before, instead of comparing the current mouse position to the position the last time the mouse moved.
Worked on positioning and sizing the creatures responsively and having them all visible no matter the screen size. Originally the sizing system changed the width and height individually, but I realized that when I replace the green squares with images the images could look stretched out if the user only changes one dimension of the screen, so I fixed that by basing both scaling systems on the smallest dimension. Then I faced an issue with overlapping boxes. At first, I thought this had to do with the sizing math, but realized that this was more of an issue with collisions.