Script Classes for Adventure Games/Block Class

From SCI Wiki
Jump to navigationJump to search

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 Block Class

Author: Jeff Stephenson

Date: 5 April 1988

 


The Block Class

The Block class implements ability to keep Actors out of certain areas on the screen without controls being added to the picture. In particular they are the only way of preventing an Actor who is allowed to have his baseRect off the bottom of the screen from walking into something, since the Actor's baseRect will not encounter any blocking controls.

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


Properties

active

Set to TRUE if the Block is active, FALSE otherwise. Actors can move into inactive Blocks.

top
bottom
left
right

The bounding coordinates of the Block rectangle.


Methods

init:

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

doit: actor

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

dispose:

Delete the Block 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 Block to TRUE, so that Actors cannot enter it.

disable:

Set the active property of the Block to FALSE, so that Actors can enter it.

 

Notes


 

Table of Contents

 

< Previous: The InvItem Class Next: The Cage Class >