Unity 2D Game Development · Lesson 3

Move and Resize Sprites

Project: Build a 2D Treasure Island Game

Beginner · Very Easy · 45–60 minutes

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.

Example scene layout made with simple sprite shapes. Students will create their own versions in Unity.

Learning objectives

  1. Create and organize multiple 2D sprites in a Unity scene.
  2. Move sprites using the Position tool.
  3. Rotate sprites using the Rotation tool.
  4. Resize sprites using the Scale tool.
  5. Modify Transform values directly in the Inspector.
  6. Create a simple game layout using at least six sprites.

Part 1 — Create the Unity project

  1. Open Unity Hub.
  2. Click New Project and choose the 2D template.
  3. Name the project TreasureIsland.
  4. Save it under C:\UnityProjects\TreasureIsland.
  5. Click Create Project.

Part 2 — Learn the Transform tools

Every GameObject has a Transform component controlling its position, rotation, and scale.

WMove
Position
ERotate
Direction
RScale
Size
TRect Tool
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
Layering tip: Set Sprite Renderer → Order in Layer to -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

  1. Select Player in the Hierarchy.
  2. Press W to activate Move.
  3. Drag the red arrow horizontally or the green arrow vertically.
  4. Place the player near the bottom-left corner of the island.
  5. In Inspector → Transform, set Position X to -3 and Y to -2.

Activity B: Rotate the rocks

  1. Select Rock 1.
  2. Press E to activate Rotate.
  3. Set Rotation Z to approximately 25.
  4. Select Rock 2 and set Rotation Z to -30.

Activity C: Resize the treasure chest

  1. Select Treasure Chest.
  2. Press R to activate Scale.
  3. Resize using the handles.
  4. Set Scale X to 1.2 and Scale Y to 0.8 in 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;
    }
}
Input setting: This script uses Unity's legacy Input Manager. If needed, navigate to Edit → Project Settings → Player → Active Input Handling and select Both or Input Manager (Old). Restart Unity if prompted. Press Play, then use arrow keys or WASD to move the player. This introductory script does not include collisions or treasure collection.

Part 6 — Student challenges

Check off each task as you finish it. The progress indicator updates automatically in this HTML page.

0 of 7 complete

Part 7 — Submit the assignment

  1. Screenshot 1: Your completed island in the Game view.
  2. Screenshot 2: Inspector displaying the Transform component of one selected sprite.
  3. Optional: Short video showing player movement.
  4. 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

  1. What is the purpose of the Transform component?
  2. What is the difference between Position and Scale?
  3. Which axis is normally used to rotate a sprite in 2D?
  4. What happens when Scale X changes from 1 to 3?
  5. What keyboard shortcuts activate Move, Rotate, and Scale?
Lesson outcome: Students will have built a static Treasure Island environment and practiced moving, rotating, and resizing sprites. The optional script adds basic player movement.