Scarecrow – Don’t look away Mobile version

It has been almost 2 years since I started to learn about unity engine and game development. And furthermore, I really like math and I practiced that several times. So, it was time to create an actual 3D game and implement what I have learned so far, so I started to develop the Scarecrow: don’t look away.

What inspired me to make this game:

The idea of the game is not unique. Sometimes I watch streamers on YouTube and Twitch playing different games and I will try to analyze the game that they are playing while I’m analyzing their behavior on the game. And one time the streamer called Valkyrae played a horror game that inspired me to create this game. (Sadly, I don’t remember the actual game’s name)

My goal was to make a game that uses vector math like distance check, dot product and cross product and I believe that in this game I achieved my goal.

 After I acquired enough knowledge to create this game, it took me almost 1 month to finish.

Well first, I have learned a lot about UI systems on unity like UI panel, buttons and sliders. In fact I used them on Level Editor section of the game. Also, it was my first game that had a main menu.

After that, I learned a lot about game states like lose, win, pause and play states. Also, I made the tutorial section of the game based on this system.

The story: In this game you are as a player who is stuck in a forest and to run away from there you should collect some objects in the forest and give them to a box called Mr. Box.

The forest has a guard called Scarecrow that doesn’t want anybody in its forest, and it hunts everybody in the forest only from behind.

The game itself has 3 main parts, main menu, settings and playground.

In the tutorial part, the game will try to teach you how to play while telling you the story of the game.

 – In order to play the game, you have two options. You can play the game by pressing the Play button on the main menu to play on a pre setup forest, or you can press Level Editor button and design your forest as you wish and then play on that.

 – On the Level Editor section, you can change the tree coverage area and the forest ground by editing the length and the width. The tree coverage area and the forest ground can be changed separately. You can also change the density of the forest and the number of objects that you should collect on the game.

 – Time is the first challenge for the player as the zombies will spawn every 30 seconds.

 – You can collect objects only when you look straight at them while you should always look at the scarecrow (the guard of the forest). So, you should either manage to look at both of them at the same time when you are collecting or collect the object really fast to look back at the scarecrow again.

 – You can walk with arrow keys or WASD keys on the keyboard and the camera is placed on the head of the player, and you can rotate and see around by moving the mouse.

 – Objects to collect are placed on the trees of the forest and you can collect them by pressing E on your keyboard when you are close enough to them and looking straight at them.

 – In the game you should always try to look at the scarecrow (the guard of the forest) otherwise it will run toward you and if it gets close enough to you it will hunt you and you will lose the game.

 – In order to win the game, you should collect all the objects in the forest and give them to a cyan color box called Mr. Box.

 – To generate trees in the game I used Poisson Disc sampling technique. Without it, every tree in the game should have checked the distance between itself and all other trees to place them at a specific distance from each other. But now it uses a grid system, and each tree is placed on a block of this grid and each block just checks the distance between itself and blocks around it. It really optimizes the game specially in the Level Editor section that trees will be generated every time that you edit the map.

 – To find that the player is looking at an object and/or scarecrow, I used just a simple vector math, dot product. And for scarecrow rotation I used a little bit of trigonometry to find the angle. I also used cross product to specify the way of rotation (left or right). I believe I could just use LookAt function inside unity engine for rotation, but I wanted to practice my math as well.