Difference between revisions of "Script Classes for Adventure Games/Cage Class"

From SCI Wiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 39: Line 39:
 
 
 
 
  
xxxxxxx body xxxxxxxx
+
==<br /> The Cage Class ==
 +
 
 +
The Cage class implements ability to keep Actors in a rectangular region.
 +
 
 +
{|
 +
|width= "125"|In file:||actor.sc
 +
|-
 +
|Inherits from:||Block
 +
|-
 +
|Inherited by:||none
 +
|}
 +
 
 +
===<br /> Properties ===
 +
 
 +
<blockquote>
 +
==== top <br /> bottom <br /> left <br /> right ====
 +
<blockquote>The bounding coordinates of the enclosing Cage.</blockquote>
 +
</blockquote>
 +
 
 +
===<br /> Methods ===
 +
 
 +
<blockquote>
 +
==== init: ====
 +
<blockquote>Add the Cage to the set of blocks for the current room and enable the Cage.</blockquote>
 +
 
 +
==== doit: actor ====
 +
<blockquote>Return TRUE if actor is inside of the Block (and is thus in a legal position) or FALSE if it is outside the Cage (and thus must be moved back in). This is called in each Actor's canBeHere: method.</blockquote>
 +
 
 +
==== dispose: ====
 +
<blockquote>Delete the Cage from the set of blocks for the current room and dispose of it if it is a dynamic instance.</blockquote>
 +
 
 +
==== enable: ====
 +
<blockquote>Set the active property of the Cage to TRUE, so that Actors cannot leave it.</blockquote>
 +
 
 +
==== disable: ====
 +
<blockquote>Set the active property of the Cage to FALSE, so that Actors can leave it.</blockquote>
 +
</blockquote>
  
 
&nbsp;
 
&nbsp;

Latest revision as of 02:00, 11 December 2015

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Index


The Cage Class

Author: Jeff Stephenson

Date: 5 April 1988

 


The Cage Class

The Cage class implements ability to keep Actors in a rectangular region.

In file: actor.sc
Inherits from: Block
Inherited by: none


Properties

top
bottom
left
right

The bounding coordinates of the enclosing Cage.


Methods

init:

Add the Cage to the set of blocks for the current room and enable the Cage.

doit: actor

Return TRUE if actor is inside of the Block (and is thus in a legal position) or FALSE if it is outside the Cage (and thus must be moved back in). This is called in each Actor's canBeHere: method.

dispose:

Delete the Cage from the set of blocks for the current room and dispose of it if it is a dynamic instance.

enable:

Set the active property of the Cage to TRUE, so that Actors cannot leave it.

disable:

Set the active property of the Cage to FALSE, so that Actors can leave it.

 

Notes


 

Table of Contents

 

< Previous: The Block Class Next: The Sound Class >