This is the Complete Unity Developer - one of the most successful e-learning courses on the internet! Completely re-worked from scratch with brand-new projects and our latest teaching techniques. You will benefit from the fact we have already taught over 360,336 students game development, many shipping commercial games as a result.
You're welcome to download, fork or do whatever else legal with all the files! The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Complete Unity Developer
- Laser Defender introduction
- What Laser Defender teaches
- Animation basics
- Using Trigger colliders
- Introduction to Particle Systems
- Open our previous game and import the menu system
- Create a unity package
- Import package into Laser Defender
- Alternatively, we can use the unitypackage from the section bundle at the beginning of this section
- Find a suitable sprite asset
- Import into our game
- Create a Player Controller Script to move it
- Restrict the movement to the playspace
Useful Links
- How to stop the spaceship from going outside the playspace
- We will check the position when moving and restrict it to something sensible
- Creating the enemy prefab
- Create an EnemySpawner that will generate enemies at runtime
- Make the EnemySpawner generate a single enemy on start
- Create a position within the EnemyFormation
- Use OnDrawGizmos() to show the position
- Turn the position into a prefab
- Change the spawning script to keep track of positions
- Showing the Formation in the Editor
- Show all four sides of the formation
- Move the formation side to side
- Fix the boundary issue with the formation getting stuck on the edge of the playspace
- Player object should spawns laser when [space] is pressed
- Create a laser prefab
- We use Instantiate() to create a new one
- We give the projectile velocity
- Enemies will respond to the projectile hitting them.
- We use Kinematic Rigidbody Triggers for the enemies
- On trigger, enemy takes damage according to projectile component
- Defining the projectile behaviour
- Detect laser collisions
- Getting the damage from the lasers
- Enemies will randomly shoot back with a tuneable frequency
- Make enemies shoot at the player
- Create enemy projectile
- Getting hit by the enemy
- Tuning the frequency
- Player shoots itself when firing!
- Lasers hit each other!
- We need the player's projectile not to collide with itself or the player
- We need the enemy projectiles to not collide with enemies or each other
- We need to know when all enemies are dead
- We use the childCount property of a transform on the positions - an empty position is a dead enemy
- We re-spawn the enemies when that happens
- Learn how to use recursive functions for the first time
- Make something happen multiple times with a delay between each time
- Enemies should animate in, rather than appear
- Create an Animator and Animation Controller
- Create states to represent arriving and flying
- Add the appropriate animation
- The background looks a little barren
- Let's add a starfield with parallax effect to give some sense of depth
- We can use a Particle System to do this.
- Explore Particle Effects
- Requires Some object to keep track of the scores
- Create the UI for the score
- We'll create a ScoreKeeper that we attach to the score
- When an Enemy dies, we'll call the ScoreKeeper
- Adding sound to your game
- Will make a huge difference to our game
- Easy enough to do
- We'll look at playing sounds independently of an object, so that we can play a death sound for the enemies
- Sprite rendering order changes which sprites are drawn on top
- Lets missiles from the player be drawn below the ship when instantiated
- Create appropriate sorting layers
- Laser defender now with layers
- Replacing the menu style
- Passing the score to the ends
- Adding our own music to the game
- Adding a background starfield
Useful Links
- Upgrade to Unity 5.
- About Web GL builds.
- Build for Web GL and share.
Here is our Unity project at this point in the section. Use it to compare code / settings etc if you get stuck.
Once un-zipped you can use File > Open Project in Unity, or browse the folders for any .unity file.
You can get to ALL videos end-state by...
- Visiting https://github.com/CompleteUnityDeveloper
- Clicking on the section name.
- Clicking XX Commits at the top-left (XX will vary)
- Against the video you want, click the <> button on right.
- On final page, click Download Zip button.
Good luck!
- Recap and what's next
- New in your toolkit
- Trigger Colliders
- Sprite Animations
- Particle Systems
- Physics Layers
- Sorting Layers