In this lesson, students will create a simple treasure island scene using Unity's 2D Game Engine. They will position, rotate, and resize sprites to build a recognizable game environment.
Learning objectives
- Create and organize multiple 2D sprites in a Unity scene.
- Move sprites using the Position tool.
- Rotate sprites using the Rotation tool.
- Resize sprites using the Scale tool.
- Modify Transform values directly in the Inspector.
- Create a simple game layout using at least six sprites.
Part 1 — Create the Unity project
- Open Unity Hub.
- Click New Project and choose the 2D template.
- Name the project
TreasureIsland. - Save it under
C:\UnityProjects\TreasureIsland. - Click Create Project.
Part 2 — Learn the Transform tools
Every GameObject has a Transform component controlling its position, rotation, and scale.
Position
Direction
Size
Resize/Edit
Transform properties
| Property | What it does |
|---|---|
| Position X | Moves left and right |
| Position Y | Moves up and down |
| Position Z | Controls depth |
| Rotation Z | Rotates a sprite in 2D |
| Scale X | Changes width |
| Scale Y | Changes height |
For example, Scale X = 2 and Scale Y = 2 make a sprite twice its original width and height.
Part 3 — Build the Treasure Island scene
Create sprites using GameObject → 2D Object → Sprites → Square or Circle. Rename each object in the Hierarchy and change its color in the Sprite Renderer.
| Object | Position (X, Y) | Rotation Z | Scale (X, Y) | Suggested color / shape |
|---|---|---|---|---|
| Water | 0, 0 | 0° | 18, 10 | Blue square |
| Island | 0, 0 | 0° | 10, 7 | Green square |
| Treasure Chest | 2, 1 | 0° | 1.2, 0.8 | Brown/yellow square |
| Player | -3, -2 | 0° | 0.7, 0.7 | Red circle |
| Rock 1 | -2, 2 | 25° | 1, 0.7 | Gray circle |
| Rock 2 | 3, -2 | -30° | 1.5, 0.8 | Gray circle |
| Tree Trunk | -3, 1 | 15° | 0.4, 1.8 | Brown square |
| Tree Leaves | -3, 2 | 0° | 1.6, 1.6 | Dark green circle |
-2 for Water and -1 for Island. Set the remaining objects to 0 or higher. For Tree Leaves to appear in front of Tree Trunk, give them a higher Order in Layer than the trunk. Adjust the Main Camera's orthographic Size if necessary to see the entire scene.Part 4 — Move, rotate, and resize
Activity A: Move the player
- Select Player in the Hierarchy.
- Press W to activate Move.
- Drag the red arrow horizontally or the green arrow vertically.
- Place the player near the bottom-left corner of the island.
- In Inspector → Transform, set Position X to
-3and Y to-2.
Activity B: Rotate the rocks
- Select Rock 1.
- Press E to activate Rotate.
- Set Rotation Z to approximately
25. - Select Rock 2 and set Rotation Z to
-30.
Activity C: Resize the treasure chest
- Select Treasure Chest.
- Press R to activate Scale.
- Resize using the handles.
- Set Scale X to
1.2and Scale Y to0.8in the Inspector.
Part 5 — Optional gameplay: Move the player
Students who are ready for a challenge can add a C# script named PlayerMovement.cs and attach it to Player. The main assignment does not require programming.
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float speed = 4f;
void Update()
{
float x = Input.GetAxisRaw("Horizontal");
float y = Input.GetAxisRaw("Vertical");
Vector3 movement = new Vector3(x, y, 0f);
transform.position += movement.normalized * speed * Time.deltaTime;
}
}
Part 6 — Student challenges
Check off each task as you finish it. The progress indicator updates automatically in this HTML page.
0 of 7 completePart 7 — Submit the assignment
- Screenshot 1: Your completed island in the Game view.
- Screenshot 2: Inspector displaying the Transform component of one selected sprite.
- Optional: Short video showing player movement.
- Unity project: Save the scene and project files according to your teacher's instructions.
Grading rubric
| Requirement | Points |
|---|---|
| Create and organize at least 8 sprites | 20 |
| Position sprites correctly | 20 |
| Rotate at least 2 sprites | 15 |
| Resize at least 3 sprites | 15 |
| Create an attractive game layout | 20 |
| Save and submit screenshots | 10 |
| Total | 100 |
Review questions
- What is the purpose of the Transform component?
- What is the difference between Position and Scale?
- Which axis is normally used to rotate a sprite in 2D?
- What happens when Scale X changes from
1to3? - What keyboard shortcuts activate Move, Rotate, and Scale?