Today, I turned my enemies into spiders. Because I haven’t had time to draw other monsters, I temporarily changed my enemies to spiders. But I did make two kinds of spiders: enemy 1 is a large, slow moving spider, and enemy 2 is a smaller spider and it moves quickly. I’ll try to add more types of monsters in the future. And I added some commands to make it impossible for the player to leave the game screen, making the game more challenging.
First, I created a Sprite Renderer for enemy 1 and 2. Then, in the assets, I imported a spider image and applied it to the Sprite Renderer. For enemy 1, I kept the default color but increased its size. And for enemy 2, I made it smaller and increased its speed.


Next, I used an if-else statement to keep the player’s x-position between -52 and 1180, and the y-position between -23 and 515. This keeps the player within those boundaries on the screen.

No Responses