Skip to content
KnowledgeCity

Unity Intermediate: 2D Gameplay

Create a scrolling background, traps, pickup items, and understand game control
Preview the first lesson free — get full access to all 7 lessons.
Course: On-Demand
Intermediate Provider Ken Geary  7 Lessons ·  53m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

You’ll explore coding as you add interactivity to pickup items, traps, and overall gameplay, as well as sending information to the UI overlay.

You’ll create a simulated scrolling background by coding the main camera to smoothly follow the player. You’ll add traps by creating a sprite prefab and coding damage values that will subtract from the player health. You’ll also create prefabs with code to keep a count of how many pickups are collected by the player. These lessons will cover incorporating player health code in the player scripts to update the player health as traps are collided with, and editing overall game control code. This tracks the pickups and sends the count to the UI overlay and health value, controlling the amount the on-screen health slider changes. You’ll launch new levels when the player crosses a checkpoint prefab, setup your build settings to sequence the main menu scene, the various play levels, and a “winner” splash screen.

What You'll Learn

  • Create scrolling backgrounds by coding the main camera to smoothly follow the player
  • Add traps and pickup items to each level using sprite prefabs
  • Code damage values for traps that subtract from player health
  • Use code to display the pickup count and update health status on the UI overlay
  • Build skills in overall game control, tracking pickups and sending the count to the UI
  • Launch new levels at checkpoint prefabs and configure build settings to sequence scenes

Key Takeaways

  • The course adds interactivity to pickup items, traps, and gameplay while sending information to the UI overlay.
  • A simulated scrolling background is created by coding the main camera to smoothly follow the player.
  • Player health code in the player scripts updates health as traps are collided with, controlling the on-screen health slider.
  • Game control code tracks pickups, sends the count to the UI overlay, and updates the health value.
  • Build settings sequence the main menu scene, the play levels, and a winner splash screen, with new levels launched at checkpoint prefabs.

Frequently Asked Questions

What will I learn in this course?

You'll learn to create scrolling backgrounds using a smooth follow for the camera, add traps and pickup items to each level, use coding to display the pickup count and health status, and build skills in overall game control.

What topics do the lessons cover?

The lessons cover Creating a Scrolling Background, Adding Traps, Adding Pickups, Coding Game Score, Coding Player Health, and Coding Game Control in two parts.

How are player health and pickups handled in this course?

You incorporate player health code in the player scripts to update health as traps are collided with, and edit game control code that tracks the pickups and sends the count to the UI overlay and health value, controlling how much the on-screen health slider changes.

What skills does this course build?

It builds skills in game programming, interactive programming, interactivity, Unity Container, UnityScript, and the Unity Engine.

What happens when the player completes a level?

New levels launch when the player crosses a checkpoint prefab, and the build settings are set up to sequence the main menu scene, the various play levels, and a winner splash screen.