Home | AGI Documentation | AGI Tutorials | AGI Tools | AGI Wiki | Community

How to Create Your Own AGI Adventure Game

By jonozon

For this tutorial you will need AGI Studio and Picedit both available here

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

Step 9: Adding the Door view to the game

Now it is time to edit the logic to add the door to the Game.

Load Logic.002 again (this time you should be able to do it by yourself!)

Now we want to add the Door view to the Game. to do this there are couple of things we need to do.

First of all place the following Lines in the If (new_room) { section.

Load.view(2); -This is required before the view is assigned to any objects or used anywhere.

Animate.obj(o1); -This tells the interpreter to activate o1. You must do this before doing anything with the object.

Set.view(o1,2); -This sets the view with the object.

position(o1,4,130); -The position on the screen of object o1 is changed to X-4,Y-130.

set.priority(o1,12); -Object o1’s priority is set to 12. The object keeps this priority wherever it goes on the screen.

set.cel(o1,0);-The current cel of object o1 is set to 0.

stop.cycling(o1); - Stops the view from cycling, that is changing cels this is what keeps the door shut.

draw(o1); -Object o1 is drawn on screen.

Now the first part of your logic should look like this.

Code:
if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(50);
  
  // The next 6 lines need only be in the first room of the game
  if ((prev_room_no == 1 ||    // just come from intro screen
      prev_room_no == 0)) {    // or just started game
    position(ego,120,140);
    status.line.on();
    accept.input();
  }
  
  Load.view(2); 
  Animate.obj(o1); 
  Set.view(o1,2);
  position(o1,4,130);
  set.cel(o1,0);
  set.priority(o1,12);
  stop.cycling(o1);
  draw(o1);
  
  draw(ego);
  show.pic();
}

Now Compile your Logic, run the game and check if the door is showing.

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


by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.
Thank you.
pixe
Top

© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.

 �