These are tutorials I created to teach basics of game development using Unity. 

CREATURE COMBAT ARENA

This is a tutorial for creating a prototype battle arena in which multiple characters battle each other. The code covers how to set up creatures and weapons through XML  to have health, speed, and damage. Then, the code randomly spawn the creatures into an area with different behaviors to determine how they battle. As the creatures battle, their health and attacks will be visualized.

A STAR PATHFINDING

A Star pathfinding allows nodes (points) to be created and searched for on a grid; then, creates a path between those nodes to be used for movement. This tutorial goes over creating the node grid and defining a start and end point. Then, the code loops through all of the neighboring nodes from the starting point and calculates a movement cost to each node. The node with the cheapest cost is stored and this process is repeated until the end node is reached. The grid allows for obstacles to beplaced in the scene at runtime and automatically updates the path.

SHUFFLEBAG

A shuffle bag is used for randomizing contents in a certain way and then drawing a specified amount from that bag. The code allows for the user to add different objects into the bag and control the frequency in which they appear. Each time an object is drawn, it is essentially removed from the bag and the other objects are randomized. The code then loads the objects into the game world and calculates their value.

ROOM GENERATION

The code starts by creating a grid then fills it with different types of rooms. When a room is generated, it check to makes sure it is not overlapping a previously generated room . Changing different parameters of the grid and placement will give unique generation of rooms. 

SCREEN SWIPING

This tutorial covers the basics of mouse movement. The user can swipe in all directions to move the camera a specified amount in that direction. By pressing space, the camera will react to any type of mouse movement. There is also the functionality to click, hold, and drag objects.

UNLOCKABLES

This code allows the user to create objects and set them to locked or unlocked, shown by changing the objects color. Objects are locked and unlocked by setting player preferences. It also contains a simple user interface in which the objects can be reset, all locked, or toggle specific objects.

Code Snippets

All sorts of useful code snippets


view code snippets