Learning Journal:
In today's class, we jumped straight back into working on Brief 2. We reviewed how Unity works, as well as some basic uses. I learned that while Unity uses realistic rendering by default, for high-end games there is the option to use different rendering settings. I thought that rendering could only be done really one way, and that to achieve a different result the creator would have to manipulate elements in their project manually. We also briefly looked at terrain creation and simple materials. I have some experience with Unreal Engine and Blender3D, so I was more familiar about materials. Only in recent months have I learned how to create and import realistic landscapes into Unreal using another software called WorldMachine. I'm looking forward to doing something similar in Unity, perhaps in a later unit. Before returning to our assignments, we also recapped the rigidbody component as physics simulators, including how it allows for more realistic collision interaction.
https://sites.google.com/sae.edu/gad170onlineguide/campus-schedules/perth/week-9
(CampusOnline page with all info & supplementary videos)
A 'dictionary' for Unity Engine scripting:
Unity Technologies. (n.d.). Unity - Scripting API. Retrieved July 28, 2022, from https://docs.unity3d.com/ScriptReference/
Brief 2 Progress
These indicate which "libraries" the code will access, such as the standard systems as well as the Unity-specific systems. Line 1 was commented out because it created confusion with a later instance of Random.Range to respawn the apple.
The snake head object was added and defined.
The apple object was added and defined.
A list for the accumulating snake body sections was added.
A Vector3 was added and defined (x, y, z). In a 2D game, only x and y will change.
Update function to make the snake head move in predefined increments, every half-second.
wrote up the commands for how the snake would interact with the apple
also added what was supposed to happen if the snake collided with itself
created brief debug feedback for when either of these actions occurred
defined the screen space for play
x axis = (-17, 17) / y axis = (-9, 9)
had the apple respawn somewhere else within that range, after being collided with and successfully "eaten" by the snake
started figuring out how to have the snake's body segments follow the head in a train, rather than as a static shape
changed the default keycodes from arrow keys to WASD keys
changed "if" statements to "else if" statements - this is to make sure that the script does not try to run more than one at the same time, in the case that multiple keys are pressed simultaneously.
manually input the Vector3 coordinates to dictate how many increments the snake would move by at each frame update
added what would happen if the snake collided with itself
the two options are to either restart the level or end the game
screenshot of the Unity hierarchy, inspector and project windows