Learn › DS Beginner

Lesson 2 of 6 · About 6 min

The touch screen

Turn the bottom screen into four buttons you press with your finger.

Meadow Hop with its touch pads below: LEFT, RIGHT, JUMP and LEAP.

How Meadow Hop turns the bottom screen into four touch pads, how it knows which one you press, and how to change what they say and how they light up.

Four pads

The bottom screen is drawn in 2D: rectangles, little pictures and text, under the 3D top screen. Meadow Hop draws four big pads along its bottom, each 64 pixels wide. When the screen is touched, the game reads where: below the line PADY, the x position says which pad, from left to right.

The pad under your finger lights up with a brighter edge, so you can feel where you are without looking.

Drawing only when needed

The bottom screen is not redrawn every frame. The game sets hud_dirty when something changes, a coin, a life, and only then draws the screen again. The progress bar and the pad highlight are the only parts drawn every frame.

This keeps a DS game fast: drawing costs time, so it draws what changed.

Your own pads

In the session you will rename the fourth pad and make the pressed pad glow green.

Meadow Hop in the editor, with the renamed touch pad and the AI's reply in the chat.
Change the pads

Try it yourself

In the app this lesson opens a real game for you, with a guide that walks you through these steps:

  1. The pads are labelled LEFT, RIGHT, JUMP and GO+JUMP. A pressed pad has a yellow edge.
  2. Rename the fourth pad to LEAP and make a pressed pad glow green.
  3. Play and press the pads on the bottom screen: each one lights up green under your finger.
Start makingDownload on the App StoreGet it on Google Play