Advertisement
NovaYoshi

Microgame scripting idea

Jan 21st, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. RAM map:
  2. 00xx: Zeropage
  3. 01xx: Stack
  4. 02xx: OAM
  5. 03xx: Variables
  6. 04xx: Actors
  7. 05xx: Map
  8. 06xx: ???
  9. 07xx: ???
  10.  
  11. Selection between 4 second or 8 second long microgames. Or boss ones?
  12. 16x15 non-scrolling metatile map, made of player-defined metatiles.
  13. Player-defined metatiles have an appearance, color, and flags (including solidity)
  14. Microgame has an init script (run once) and run script (run every frame).
  15.  
  16. 16 actor slots for moving game objects
  17. Actors contain:
  18. Type
  19. Direction
  20. X Position, Y Position
  21. X Speed, Y Speed
  22. Four generic 8-bit values, default to zero
  23. Actor type selects which scripts (init, run), appearance and size to use.
  24.  
  25. Actors are placed into predefined locations at the start of the microgame
  26. but more can be spawned in with actions.
  27.  
  28.  
  29.  
  30. ---Programming conditions---
  31. Control whether a block of actions are executed or not.
  32. Can be nested and placed inside action blocks, and combined (AND, OR) or negated (NOT).
  33. Should there be an else block?
  34. ---
  35.  
  36. -Controller-
  37. [button] just pressed
  38. [button] just released
  39. [button] held
  40.  
  41. -Misc/time-
  42. Random chance (generate random 8-bit number, must be >= [value])
  43. Every [value] frames (probably limited to a power of 2)
  44. Time elapsed is between [value] and [value]
  45. At end of microgame
  46.  
  47. -Math comparisons-
  48. [variable] is < [value]
  49. [variable] is > [value]
  50. [variable] is <= [value]
  51. [variable] is >= [value]
  52. [variable] is == [value]
  53. [variable] is != [value]
  54.  
  55. -Finding another object-
  56. Touching object of type [type]
  57. There is an object of type [type]
  58. (These two leave the index of the other object in a variable, referenced by "other object" in action list)
  59.  
  60. -Win/Loss-
  61. Game has been won
  62. Game has been lost
  63. Game is currently won
  64. Game is currently lost
  65.  
  66. -Difficulty-
  67. Is easy
  68. Is medium
  69. Is hard
  70.  
  71. -Map-
  72. Actor is in section of the screen [x1][y1] to [x2][y2]
  73. Actor is touching a solid metatile
  74. Actor is touching metatile of type [type]
  75. Actor is touching metatile with flag [flag]
  76. (Map conditions will store the X and Y of the affected metatile somewhere)
  77.  
  78. Map tile at [x] [y] is [type]
  79. Map tile at [x] [y] has flag [flag]
  80.  
  81.  
  82. ---Programming actions---
  83. Commands that run either every frame or in response to a condition.
  84. ---
  85.  
  86. -Miscellaneous/Meta-
  87. Stop executing script
  88. Play premade sound effect [number]
  89. Call assembly language routine
  90. Win game
  91. Lose game
  92.  
  93. -Creation/Destruction-
  94. Create object of type [type] at [x], [y]
  95. Shoot out object of type [type] in current direction at speed [value]
  96. (Puts the new object index in the "other object" index variable)
  97.  
  98. Destroy this object
  99. Destroy all [type] objects
  100.  
  101. -Movement-
  102. Movement types, runs one frame of a given type of movement:
  103. Ball movement (X += cos(Direction) * Speed, Y += sin(Direction) * Speed)
  104. Vector movement (X += X Speed, Y += Y Speed)
  105. 8-way movement (Player-controlled, can have directions restricted)
  106. Platformer (Player-controlled)
  107.  
  108. Stop movement (Zero out speed values)
  109.  
  110. Reverse (Negate speed values)
  111. Go to [x],[y]
  112. Jump to position of other object
  113. Swap positions with other object
  114.  
  115. -Math-
  116. Set [variable] to [value] + [value]
  117. Set [variable] to [value] - [value]
  118. Set [variable] to [value] * [value]
  119. Set [variable] to [value] / [value]
  120. Set [variable] to [value] << [constant]
  121. Set [variable] to [value] >> [constant]
  122. Set [variable] to [value] min [value]
  123. Set [variable] to [value] max [value]
  124. Set [variable] to random number [min]-[max]
  125. (Variables can be microgame global variables or per-object state ones)
  126.  
  127. -Map-
  128. Set metatile at [x],[y] to [type]
  129.  
  130. -Target for actions-
  131. Target this object again
  132. Target other object (from the condition)
  133. (This action allows you to do actions as another object temporarily)
  134.  
  135.  
  136.  
  137. ----------------------------------------------------------
  138.  
  139. Catch falling objects:
  140.  
  141. Initial map state:
  142. Player placed at center of bottom row, nothing else
  143. Game:
  144. Every 32 frames:
  145. Set [Temp] to random [4] to [12]
  146. Set [Temp] to [Temp] << [4]
  147. Create catchable at [Temp], [16]
  148. At end of microgame:
  149. Win game
  150. Player:
  151. Left/Right movement
  152. Catchable:
  153. Set [Y position] to [Y Position] + [4]
  154. If touching [Player]:
  155. Destroy
  156. If touching bottom of screen:
  157. Lose game
  158. Destroy
  159.  
  160.  
  161.  
  162. Get all of an object:
  163. Initial map state:
  164. Player placed somewhere
  165. A few of a collectible placed wherever
  166. Collectible init:
  167. Set [Temp] to random [32] to [224]
  168. Set [X position] to [Temp]
  169. Set [Temp] to random [32] to [200]
  170. Set [Y position] to [Temp]
  171. Collectible:
  172. If touching [player]:
  173. Destroy
  174. If there is not an object of type [Collectible]:
  175. Win game
  176. Player:
  177. 8-way movement
  178.  
  179.  
  180.  
  181. Avoid stuff:
  182. Initial map state:
  183. Player placed somewhere
  184. Some enemy objects placed wherever
  185. Game:
  186. At end of microgame:
  187. Win game
  188. Enemy init:
  189. Set [Direction] to random [0] to [31]
  190. Enemy:
  191. Ball movement
  192. Every 16 frames:
  193. Random chance [128] in 255:
  194. Set [Direction] to random [0] to [31]
  195. Player:
  196. 8-way movement
  197. If touching [enemy]:
  198. Lose
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement