Arvutiteaduse instituut
  1. Kursused
  2. 2018/19 sügis
  3. Arvutimängude loomine ja disain (MTAT.03.263)
EN
Logi sisse

Arvutimängude loomine ja disain 2018/19 sügis

  • Main
  • Lectures
    • Homework 1
    • Homework 2
    • Homework 3
  • Labs
    • Lab1 Introduction to Unity
    • Lab2 Unity Components
    • Lab3 & 4 Space Game
    • Lab5 Project Setup
    • Lab6 Tower Defence
    • Lab7 Tower Defence GUI & Buildings
    • Lab8 Tower Defence Content
    • Lab9 Blender Tree
    • Lab10 Sounds
    • Lab11 Animations
    • Lab12 Level Design
    • Lab13 Editor Extensions
    • Lab14 Lighting
    • Lab15 Procedural Generation
  • Projects
    • Design Document
  • Links

Lab 3 & 4 - Introduction to Unity

This lab consists of 2 practice sessions. You have to submit this task only once so you have 2 weeks in total to do this task. But it is recommended to complete at least first 9 steps before the beginning of lab 4. The deadline for this task is before the beginning of lab 5.

Implement a shoot them up (shmup) style space game. Your game should look similar to the following picture:

Steps:

  1. Download graphics files: https://opengameart.org/content/space-shooter-redux
  2. Download background shader: https://optimatica.eu/courses/shmup/background_shader.zip
  3. Create a new Unity 2D project
  4. Make infinitely scrolling background:
    1. Add graphics and background.shader to your project.
    2. Create a new background material using background.shader (Shader->Custom->Background), add a suitable background texture to it, change the textures’ wrap mode to “Repeat”.
    3. Add a 3D quad to your scene, add background material to it, scale it up, move it further on the z-axis and attach it to your camera.
    4. Make the camera move continuously upwards
  5. Add player spaceship:
    1. Add a spaceship sprite to your scene. Attach a new SpaceShip script to it.
    2. Make your ship to follow your mouse cursor.
    3. Bound the ship inside the visible play area. Hint: https://answers.unity.com/questions/501893/calculating-2d-camera-bounds.html
    4. Add a 2D collider to your ship
    5. Extra: make your ship tilting left or right depending on the direction you are moving.
  6. Make spaceship shoot automatically:
    1. Create a new bullet prefab with appropriate sprite and collider.
    2. Make the bullet move forward.
    3. Destroy the bullet when it leaves the view.
    4. Make the player ship to spawn bullets every fixed amount of time.
  7. Add enemy ships:
    1. Create enemy ship prefab, with sprite, collider, and script.
    2. Add health parameter to it, destroy it when health reaches 0.
    3. Do damage to enemy ships when they collide with your bullets.
    4. Add lives parameter to the player ship, restart the game when it reaches 0.
    5. When the player collides with an enemy remove one life and destroy the enemy ship.
    6. Add linear movement vector to enemy ships. Move it to that direction when it is close to the camera.
    7. Make enemy ships rotate towards their moving direction
    8. Add multiple enemy ships to your scene and test it.
  8. Add UI:
    1. Create a new UI Canvas with canvas scaler that scales your UI proportionally to the screen size.
    2. Add a score text with a custom font (you can find one under the Bonus folder).
    3. Add an energy bar that consists of foreground and background images. The foreground image should have an image type "filled" property.
    4. Add a panel with small ship images representing remaining lives.
    5. Add horizontal layout group to the panel to align images automatically.
    6. Add a UI script to your canvas that gets references to all the necessary UI elements and provides public methods to change score, energy and remaining lives.
    7. Assign the UI script to a static variable so you can access it from everywhere.
  9. Add lives and score:
    1. When your player loses a life, remove it from UI as well.
    2. Make your player invincible for a few seconds after losing a life.
    3. Reduce the opacity of the player ship while it is invincible.
    4. Every time you destroy an enemy ship, increase your score.
  10. Add win and lose conditions:
    1. When you lose all your lives, show a “You Lost” text on UI for a few seconds before restarting.
    2. When you reach far enough in your level, show a “You Won” text on UI for a few seconds before restarting.
    3. Under both of these texts show a smaller text with your score, eg: “Your score: 999”
    4. Add a darker background behind win and lose texts.
  11. Add shield skill:
    1. Make your right mouse button to spawn a shield around your ship that prevents taking damage.
    2. Holding the button down should reduce your energy.
    3. Do not spawn the shield while energy is depleted.
    4. Recharge the energy slowly when the skill is not active.
  12. Add particle effects:
    1. Make enemies and your own ship to spawn particles when destroyed.
    2. Extra: add thruster particles behind your ship.
  13. Add more types of enemies (at least 3 in total), they have to implement the following features:
    1. Make some enemies shooting their own projectiles towards you.
    2. Make some enemies with more complex moving patterns, you can either use a math function like a sine wave, animation curve or even a custom animation.
  14. Add laser beam skill:
    1. Make your left mouse button fire a laser beam.
    2. The laser beam is a line that travels instantly from your ship to the top of the screen. It should not go any further.
    3. Laser beam damages all the enemies in between.
    4. Laser beam also spends energy similar to the shield skill.
  15. Add powerups:
    1. Add at least two types of powerup pellets that can be consumed by touching with your spaceship.
    2. Some ideas about what a powerup can do:
      1. Increases your rate of fire permanently
      2. Adds an extra health
      3. Replenishes energy
      4. Shoots a radial wave of bullets out of your spaceship
  16. Add levels:
    1. Make a copy of your scene and create a more difficult level in it.
    2. After you win a game switch to the second level instead of restarting.
    3. Make the first level about 1 minute long and not very hard to beat on the first try.
    4. Your first level should have at least 3 types of enemies and 2 types of powerup pellets.
  17. Build your game and test it.

Submission

Submit a compiled version of your game (Windows 64 build). Zip your build folder into a single package and make sure that all the additional files (that were created when building the game) are also included in this package. Don't submit your source code.

6. Lab 3 & 4 - Space Game
Sellele ülesandele ei saa enam lahendusi esitada.
  • Arvutiteaduse instituut
  • Loodus- ja täppisteaduste valdkond
  • Tartu Ülikool
Tehniliste probleemide või küsimuste korral kirjuta:

Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
Courses’i keskkonna kasutustingimused