home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / games / gamesuite / !Amnesia / AmsHelp / Flags < prev    next >
Text File  |  1995-01-29  |  7KB  |  188 lines

  1. Amnesia Flags - for Amnesia 1.00
  2. ================================
  3.  
  4. Amnesia flags are contained in a 4 byte word at offset +4 from the start of
  5. an Amnesia object.  Bit 0 is the least signifacant bit (it’s on the right
  6. when the number is written down).
  7.  
  8. An Amnesia Object
  9. -----------------
  10.  
  11. An Amnesia object is made up of 8 or more bytes in the following form:
  12.  
  13. Offset | Use
  14. -------------------------
  15.  0     | sprite number - set to zero to indicate a dead object
  16. +4     | flags
  17. +8     | x position
  18. +12    | y position
  19. +16    | x velocity
  20. +20    | y velocity
  21. +24    | timer
  22. +28    | object size in pixels
  23. +32    | timer 2
  24.  
  25. The following describes the meaning of the flags at offset +4.  The bits
  26. determine what happens to the object on each process pass.
  27.  
  28. Bit 0 - Plot with FastSpr
  29. -------------------------
  30.  
  31. If this bit is set the object is plotted by FastSpr as a sprite.  The first
  32. word of the object is passed to FastSpr as a sprite number in R0.  The x and
  33. y positions are shifted right 12 places before being passed to the
  34. FastSpr_Plot SWI in R1 and R2.
  35.  
  36. Bit 1 - User Plot
  37. -----------------
  38.  
  39. If this bit is set the object is returned to the user for plotting.  The user
  40. routine must extract the coordinates as necessary and plot the object itself.
  41.  
  42. Bit 2 - Use velocities
  43. ----------------------
  44.  
  45. If this bit is set the velocities at offsets +16 and +20 are added to the
  46. position values at +8 and +12 and the results stored back at +8 and +12. 
  47. This is a simple way to move an object around.
  48.  
  49. Bit 3 - Apply gravity
  50. ---------------------
  51.  
  52. If this bit is set the current gravity value, set by Amnesia_SetGravity, is
  53. added to the velocity at +16 and +20, and the result stored back to +16 and
  54. +20.  Note that gravity may be in any direction.
  55.  
  56. Bit 4 - Use plot offsets
  57. ------------------------
  58.  
  59. If this bit is set the plot offsets, set by Amnesia_SetPlotOffset, are added
  60. to the object coordinates before the object plotted by FastSpr.  The offsets
  61. are added before the values are shifted right.  Note that user plot routines
  62. must handle this for themselves.
  63.  
  64. Bit 5 - Use timer for FastSpr animation
  65. ---------------------------------------
  66.  
  67. If this bit is set the timer (offset +24) is used for animation.  FastSpr
  68. supports animation using bits 23-16 of the sprite number.  If this bit is
  69. set, Amnesia will ORR the top 8 bits of the timer value into this position so
  70. that an animation will run without user intervention.  The help files in
  71. FSPConv have more information about FastSpr animation.
  72.  
  73. Bit 6 - Make up the object size from FastSpr file
  74. -------------------------------------------------
  75.  
  76. If this bit is set the object size (offset +28) is derived from the FastSpr
  77. file using the SWI FastSpr_ReadSize.  This can be a handy timesaver in most
  78. cases.  Note that the sprite number at offset 0 must be the number of a valid
  79. sprite, and that sprite must already be loaded when the object is made. 
  80. FastSpr_ReadSize is called once when the object is created and the result
  81. stored at offset +28.  Any subsequent changes in the sprite file or object
  82. will not update the size entry.
  83.  
  84. Bit 7 - Object needs collision checking
  85. ---------------------------------------
  86.  
  87. If this bit is set the position of the object (strictly speaking the bounding
  88. box) is added to the collision checking table.  See the docs on collision
  89. checking for more details.
  90.  
  91. Bit 8 - Generate attention request if timer expires
  92. ---------------------------------------------------
  93.  
  94. If this bit is set Amnesia will generate an attention for the object when the
  95. timer value is negative - ie the timer expires.  See the timer docs for
  96. further information.  Note that care must be taken to ensure to stop this
  97. attention occuring repeatedly once the timer has expired.
  98.  
  99. Bit 9 - Destroy object if timer expires
  100. ---------------------------------------
  101.  
  102. If this bit is set the object will be destroyed if the timer becomes
  103. negative.  The object is not returned for attention before the object is
  104. destroyed.  Set bit 8 as well if you want this to happen.
  105.  
  106. Bit 10 - Always request an attention
  107. ------------------------------------
  108.  
  109. If this bit is set the object is returned for attention on each process pass.
  110.  
  111. Bit 11 - Run timer 2
  112. --------------------
  113.  
  114. If this bit is set Amnesia will run a second timer at offset +32.  This timer
  115. will not generate attention or destroy objects regardless of the settings of
  116. bits 8 and 9.
  117.  
  118. Bit 12 - Zero velocities
  119. ------------------------
  120.  
  121. If this bit is set Amnesia will zero the object velocities at offsets +16 and
  122. +20 after they have been added to the positions (at +8 and +12) once.  It
  123. will also zero this bit in the flags.
  124.  
  125. Bit 13 and 14 - Object uses the game window
  126. -------------------------------------------
  127.  
  128. If bit 13 is set the object will return for attention if it is outside the
  129. game window in the x (horizontal) direction.  If bit 14 is set the object
  130. will return for attention if it is outside the game window in the y
  131. (vertical) direction.  It is possible for both to occur at once.  See the
  132. window docs for further information.
  133.  
  134. Bit 15 - Object obeys the plot window
  135. -------------------------------------
  136.  
  137. If this bit is set the object will only be plotted (either by FastSpr or a
  138. user routine) if any part of it is inside the plot window.  The plot offset
  139. is added to the coordinates before the comparison.  See the window docs for
  140. further information.
  141.  
  142. Bit 16 - Object obeys the kill window
  143. -------------------------------------
  144.  
  145. If this bit is set the object will be killed (deleted) if it is outside of
  146. the kill window.  The object will be returned for attention before it is
  147. deleted.  See the window docs for further information.
  148.  
  149. Bit 17 - Add to collision checking table only if within plot window
  150. -------------------------------------------------------------------
  151.  
  152. If this bit is set the object will only be added to the collision checking
  153. table if it is inside the plot window.  It may be used to reduce the load on
  154. collision checking routines if necessary.
  155.  
  156. Bit 18 - Object should be saved
  157. -------------------------------
  158.  
  159. The objects in a table may be saved using the SWI Amnesia_SaveTable.  Objects
  160. will only be saved if this bit is set in their flags.
  161.  
  162. Bit 19 - Reserved for future expansion
  163. --------------------------------------
  164.  
  165. Set this bit to zero.
  166.  
  167. Bits 20-23 - User transient flags
  168. ---------------------------------
  169.  
  170. These bits are set to zero on each process pass.  They may be used for any
  171. purpose by the user.  These flags were primarily intended to store collision
  172. handling information.
  173.  
  174. Bits 24-31 - User attention flags
  175. ---------------------------------
  176.  
  177. These bits can be set by the user to generate attention request for specified
  178. groups of objects.  If, say, bit 27 is set in the table number passed to
  179. Amnesia_SelectTable all objects with bit 27 set in their flags will be
  180. returned for attention.
  181.  
  182. ****************************************************
  183.     This document is copyright A.Southgate 1994.
  184.     It may be freely distibuted and copied but
  185.     should not be modified, otherwise things will
  186.     get very confusing.
  187. ****************************************************
  188.