agidev.com
 Home | Intro | News | Games | Community | NAGI |  Articles  | Download | Links

Articles

Tutorial 1

How to Create Your Own AGI Adventure Game

For this tutorial you will need AGI Studio and Picedit both available at http://agisci.cjb.net


Page: 1 2 3 4 5 [ 6 ] 7 8 9

Step 6: Editing the First Room Logic

Load the Logic rescource for the first room (Logic.002).

Remove the following lines:

// Check What room the player came from and position them 
// on the screeen accordingly, e.g:
// if (prev_room_no == 5) {
//    position(ego,12,140);
// }

Scroll down until you see this line:

if (said("look")) {
   print("This is an empty room");
   }

Change it so it reads:

if (said("look")) {
   print("You are standing on a meadow which has a shack on it");
   }

Add a line which reads:

if (said("look","shack")) {
   print("There is a blue door in the shack");
   }

The if (said.... Line tells the interpreter what to do if a certain word is said eg. look. These words are stored in the Words.TOK File.

Remove the following lines as well.

if (ego_edge_code == horizon_edge) {  // ego touching horizon
  new.room(2);
}

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(2);
}

if (ego_edge_code == bottom_edge) {   // ego touching bottom edge of screen
  new.room(2);
}

if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(2);
}

These lines tell the interpreter to change rooms when the Ego hits the edge of the screen.

Now open the Words.TOK editor and click on add group.

Words.Tok Editor Button

This group is number "32".

Click on add word and type in Shack

Close the Words.TOK editor.

Compile the logic and run the game by pressing F10

Page: 1 2 3 4 5 [ 6 ] 7 8 9