O'Reilly logo

Ruby For Kids For Dummies by Christopher Haupt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project 10

A-maze-ing

It’s time to take the leap into graphical programs and user interfaces. Up until now, you’ve programmed a series of projects that used output to the terminal to interact with the code’s user. ASCII art is fun, but making a project with colorful graphics that the user can interact with is even better.

In this project, you create a simple maze exploration and treasure gathering game. You can design any maze that you like using text strings that describe the level. The text looks a little like ASCII art, in fact! But in this project, your code converts it into a graphical display with different color tiles. The user moves around in the maze and collects as many treasures as she can in the least time possible.

image

Organizing a New Project

In this project, you’ll use Atom to create and edit your program. Unlike other projects, this program’s source code will be stored in five different files, one for each class you create. Each file will be named after the class it contains, and all the files will be stored in the same project directory. You’ll use the terminal program to run and test the code, but this time the project will create its own window in which the game is played.

remember If you haven’t created a development folder already, refer to Project 2 for instructions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required