Skip navigation

Code

The code of this service is divided in four main sections: logic, graphic, menus and animations; this is to make it easy to consult and simple to insert new lines of code.

ff

Logic

Firstly, we indicate the hierarchy of the program, by declaring all the screens and the menu items, together with other related variables (like the focus of each menus, for instance).

Then we declared the images, which are then immediately.

fffff

The fundamental part of this section is the void setup, which is executed only once and prepares the program to run.

ffff

Inside void keyPressed we declared all the screens and each of them recalls another function (for example keyPressedStuff), inside which are defined the behavior of the program when one of the buttons is pressed.

fff

Graphic

In this section there is all the information about the graphic aspects of the service. With void draw we indicated the different screens, which call another function, where we put the information about background, images, texts, etc.

Still inside these functions we called other functions thar are declared in the following sections of the code, like animations and menus.
The presence of so many functions and sub-functions that call each other is the answer to the need to have a high level of control of the code, so to locate any errors
quickly .

fff

Menus

Here we coded the three main menus of the service: choose language, choose character and look at a magic object.
The icons move on a circular path by pressing the two arrows left and right. The selected icon is bigger and over a light spot.

To make this possibile we had to create two pairs of arrays for each menu: two that call the icons (big and little) and other two that indicate their position at every button press.

fff

Animations

The animation uses a strip of images, the y position of which is updated based on the framerate set up, giving the impression that the character moves.
All the strips are made of five consecutive images.

Throughout the code there are a lot of comments which we hope will help you to understand the program more easly.

ffff

Ready? Set… Go! | Concept | Design | Step-through | Scenarios | Video prototype
Technology
| Code | Who did what | Work in progress | Download