Script Classes for Adventure Games/Cycling Classes: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
Andrew Branscom (talk | contribs)
No edit summary
Line 1: Line 1:
[[Category:SCI Pages]]
[[Official SCI Documentation]]<br />
[[Official SCI Documentation]]<br />
[[Script Classes for Adventure Games | Table of Contents]]
[[Script Classes for Adventure Games | Table of Contents]]
<div align="center">
<div align="center">
Chapter:  
Chapter: for Adventure Games/Introduction|1]] |  
[[Script Classes for Adventure Games/Introduction|1]] |  
[[Script Classes for Adventure Games/RootObj Class|2]] |  
[[Script Classes for Adventure Games/RootObj Class|2]] |  
[[Script Classes for Adventure Games/Object Class|3]] |  
[[Script Classes for Adventure Games/Object Class|3]] |  
Line 32: Line 31:
[[Script Classes for Adventure Games/Global Variables|27]] |  
[[Script Classes for Adventure Games/Global Variables|27]] |  
[[Script Classes for Adventure Games/Index|Index]]
[[Script Classes for Adventure Games/Index|Index]]
</div><br />
</div><
 
<div align="center"><span style="font-size: 22pt">The Cycling Classes</span><br />''Author: [[Jeff Stephenson]]''<br />''1988-04-05''</div></div>
<div align="center"><span style="font-size: 22pt">The Cycling Classes</span><br />
''Author: [[Jeff Stephenson]]''<br />
''Date: 5 April 1988''</div>
 
&nbsp;


<br />
==<br /> The Cycling Classes ==
==<br /> The Cycling Classes ==


Line 178: Line 173:
==<br /> References ==
==<br /> References ==


<references />
<references /><!-- Do not edit this section. It is autopopulated by <ref></ref> tags -->


==<br /> See Also: ==
==<br /> Also See ==


* [[:Category:SCI Documentation|SCI Documentation]]
* [[:Category:Official SCI Documentation|Official SCI Documentation]]
* [[:Category:SCI Scripting|SCI Scripting]]
* [[:Category:SCI Classes|SCI Classes]]
* [[:Category:SCI Cycling Class|The SCI Cycling Class]]
* [[SCI Specifications]]
* [[SCI Specifications]]
&nbsp;
&nbsp;


[[Official SCI Documentation]]<br />
[[Script Classes for Adventure Games | Table of Contents]]
[[Script Classes for Adventure Games | Table of Contents]]


<span style="float: left">[[Script Classes for Adventure Games/PicView Class|&lt; Previous: The PicView Class]]</span>
<span style="float: left">[[Script Classes for Adventure Games/PicView Class|&lt; Previous: The PicView Class]]</span>
<span style="float: right">[[Script Classes for Adventure Games/Motion Classes|Next: The Motion Classes &gt;]]</span>
<span style="float: right">[[Script Classes for Adventure Games/Motion Classes|Next: The Motion Classes &gt;]]</span>
&nbsp;
&nbsp;
[[Category:References]]
[[Category:References]]
[[Category:SCI References]]
[[Category:SCI References]]
[[Category:Historical Pages]]
[[Category:SCI Historical Pages]]
[[Category:Development]]
[[Category:SCI Development]]
[[Category:Documentation]]
[[Category:Documentation]]
[[Category:SCI Documentation]]
[[Category:SCI Documentation]]
[[Category:Official Documentation]]
[[Category:Official SCI Documentation]]
[[Category:Scripting]]
[[Category:Scripting]]
[[Category:SCI Scripting]]
[[Category:SCI Scripting]]
[[Category:Classes]]
[[Category:Classes]]
[[Category:SCI Classes]]
[[Category:SCI Classes]]
[[Category:SCI Cycling Class]]
[[Category:SCI Cycling caller]]
[[Category:SCI Cycling client]]
[[Category:SCI Cycling cycleDir]]
[[Category:SCI Cycling cycleCnt]]
[[Category:SCI Cycling init]]
[[Category:SCI Cycling doit]]
[[Category:SCI Cycling nextCel]]
[[Category:SCI Cycling cycleDone]]
[[Category:SCI Cycling Forward]]
[[Category:SCI Cycling Walk]]
[[Category:SCI Cycling Reverse]]
[[Category:SCI Cycling CycleTo]]
[[Category:SCI Cycling endCel]]
[[Category:SCI Cycling EndLoop]]
[[Category:SCI Cycling BegLoop]]

Revision as of 21:57, 12 January 2026

Official SCI Documentation
Table of Contents

Chapter: for Adventure Games/Introduction|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 Cycling Classes
Author: Jeff Stephenson
1988-04-05



The Cycling Classes

The Cycle class is the basic class which implements cycling behavior in Actor and its sub-classes. Sub-classes of Cycle implement specific cycling behavior.


Cycle

In file: motion.sc
Inherits from: Code
Inherited by: Forward
Reverse
CycleTo


Properties


caller

The object to be cue:ed when the Cycle completes.


client

The Prop, Actor, etc. which is being cycled by an instance of Cycle.


cycleDir

The direction in which the client's cels are to be cycled.

1 forward (cel numbers should increase)
-1 backward (cel numbers should decrease)


cycleCnt

The number of animation cycles since the current cel of the client was displayed. When this equals the cycleSpeed of the client, the nextCel: method is invoked.


Methods


init:

Do any necessary initialization of the Cycle class and ensure that the client is updating.


doit:

Called by the client as doit: self, this method sets the cel of the client to the appropriate value based on the particular Cycle class.


nextCel:

Used by the doit: method to move the cel number in the direction indicated by cycleDir.


cycleDone:

This is invoked when the client's cel reaches a destination cel. If the Cycle class is one of the cyclic ones, this just wraps the cel to either the beginning or end of the current loop. If it is a terminating Cycle class, this cue:s the caller.


Forward

Cycles an Actor through its cels in the 'normal' order — from 0 through the end of the loop and back to 0. Set with (actor setCycle:Forward).

In file: motion.sc
Inherits from: Cycle
Inherited by: Walk


Walk

This is a Forward cycle type which only cycles an Actor when the Actor is moving. Set with (actor setCycle:Walk).

In file: motion.sc
Inherits from: Forward
Inherited by: none


Reverse

Cycles an Actor through its cels in the reverse order of that in Forward, i.e. from the highest cel number to 0 and then repeating. Set with (actor setCycle:Reverse).

In file: motion.sc
Inherits from: Cycle
Inherited by: none


CycleTo

This class allows you to cycle to an arbitrary cel and stop. It is set by (actor setCycle:CycleTo toCel direction [caller]).

In file: motion.sc
Inherits from: Cycle
Inherited by: EndLoop
BegLoop


Properties


endCel

The number of the cel at which the cycling is to complete.


EndLoop

This sub-class of CycleTo advances the cel of an Actor from the current cel to the cel which is the end of the current loop for the Actor, then stops and cue:s its caller (if it has one). Set with (actor setCycle:EndLoop [caller]).

In file: motion.sc
Inherits from: CycleTo
Inherited by: none


BegLoop

This sub-class of CycleTo decrements the cel number from its current value to 0, then stops and cue:s its caller, if any. Set with (actor setCycle:BegLoop [caller]).

In file: motion.sc
Inherits from: CycleTo
Inherited by: none


References



Also See

 

Official SCI Documentation
Table of Contents

< Previous: The PicView Class Next: The Motion Classes >