SHARE
TWEET

Documentation for EEObject

JoshON Mar 22nd, 2016 (edited) 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ~~NOTES~~
  2. The tutorial on how to use EEObject is below the documentation.
  3. Please read the tutorial first if this is the first time you are using EEObject.
  4. ~~DOCUMENTATION~~
  5. EEObject:
  6.  VARIABLES:
  7.   -map - The EEObjectMap the EEObject is using
  8.   -con - The PlayerIOClient.COnnection the EEObject is using
  9.   -x - The X position of the EEObject
  10.   -y - The Y position of the EEObject
  11.   -blockId - The Block ID that the EEObject will place when it moves
  12.   -replaceBlockId - The Block ID the EEObject will place when it moves to cover it's movement
  13.   -blockLayer - The block layer when the EEObject moves to place
  14.   -objectIsAlive - If the EEObject is currently alive
  15.   -objectIsMoving - If the EEObject is moving from one place to another, aka, if it's currently being placed
  16.   -blockPlaceParameters - The parameters that are required to place the block normally. Set null if there are none
  17.   -replaceBlockParameters - The parameters that are required to place the block to replace the old EEObject's block. Set null if there are none
  18.  
  19.  
  20. ~~TUTORIAL~~
  21. Hello! I suppose you're wondering how to use EEObject.
  22. Getting started is really easy! First, you need to use EEObject.
  23.  
  24. using EEObjects;
  25.  
  26. Next, you need to create an EEObjectMap for your EEObject to live on!
  27.  
  28. EEObjectMap map = new EEObjectMap();
  29.  
  30. Now, you'll have to initialize your map.
  31. Lets say we want a map, and an EEObject can't be on or go to the left of x1, the EEObject cant go to the right or be on x2, the EEObject cant go above or on y1, and the EEObject can't go below y2. If you can't see that, here is a visually drawn map.
  32.  
  33. +--y1---+
  34. |       |
  35. x1     x2
  36. |       |
  37. +--y2---|
  38. ^^^^^^^^^
  39. No EEObject can go on the borders, or past the borders.
  40. Lets say:
  41. x1 = 0
  42. x2 = 25
  43. y1 = 0
  44. y2 = 25
  45.  
  46. Now we have some features we need to be sure of.
  47. If the EEObject goes past the map, do we want to "Overlap" it?
  48. Overlapping is simple. If an EEObject is out of bounds, it'll hop back onto the EEObjectMap next to the other side of the EEObjectMap. For example, if an EEObject is past the left side of x1 for example, it'll go directly 1 block to the left of x2.
  49.  
  50. We also have the "Kill" feature.
  51. If the EEObject goes past the map, do we want to Kill it?
  52. Killing is simple. If an EEObject is out of bounds, we'll stop the thread (if it's using a thread) it's using.
  53.  
  54. Now that in your mind you have discussed how you would like to do that, do the following.
  55. If you would like to Overlap, put true, else, put false.
  56. If you would like to Kill, put true, else, put false.
  57.  
  58. In my case, I'd like to kill the EEObject.
  59. Overlap = false
  60. Kill = true
  61.  
  62. Let's put this together.
  63.  
  64. map.Initialize(0, 25, 0, 25, false, true);
  65.               x1  x2 y1  y2 Overlap Kill
  66.  
  67. Now we have our map nice and created.
  68. Let's create an EEObject.
  69.  
  70. EEObject pellet = new EEObject();
  71.  
  72. We have to initialize it.
  73. You first have to put the X and Y of the object. In this case, I'll use 24, 24 so that the "pellet" will be on the very edge of the map, the lower-right corner.
  74. x = 24
  75. y = 24
  76.  
  77. The ID of the object I will be using will be 9, for a gray basic block.
  78. blockId = 9
  79.  
  80. The block I want to replace it will be 0, so when the EEObject moves, it'll place "air", or "erase" its step.
  81. replaceBlockId = 0
  82.  
  83. The amount of time I want to wait inbetween placing blocks is 19.
  84. blockPlacementTime = 19
  85.  
  86. The layer the block will be placed on is 0, since I want to place them on the foreground
  87. blockLayer = 0
  88.  
  89. If we want to use threading. Usually a bad idea.
  90. threading = false
  91.  
  92. The connection that will be used to place them is "con", since that is my Connection to EE.
  93. connection = con
  94.  
  95. The map the EEObject will live on will be the one we created! "map"!
  96. map = map
  97.  
  98. We dont want any extra stuff on our block, such as number values or anything, so we'll leave the rest blank.
  99. Our Initialization function looks like this:
  100.  
  101. pellet.Initialize(24, 24, 9, 0, 19, 0, false, con, map);
  102.                    x   y |   |  |   |      |    |   |
  103.                          v   |  |   |      |    |   |
  104.                    blockId   |  |   |      |    |   |
  105.                              v  |   |      |    |   |
  106.                 replaceBlockId  |   |      |    |   |
  107.                                 v   |      |    |   |
  108.                blockPlacementTime   |      |    |   |
  109.                                     v      |    |   |
  110.                            blockLayer      |    |   |
  111.                                            v    |   |
  112.                                    threading    |   |
  113.                                                 v   |
  114.                                       connection    |
  115.                                                     v
  116.                                                   map
  117.  
  118.  
  119. Now we have created a living EEObject on an EEObjectMap.
  120.  
  121. Code so far:
  122.  
  123. using System;
  124. using SystemStuffBlahBlah;
  125. using EEObjects;
  126. namespace Program
  127. {
  128.     class Main
  129.     {
  130.         public static Connection con
  131.         static EEObjectMap map = new EEObjectMap();
  132.         static void Main()
  133.         {
  134.             //Insert connecting to EE code here//
  135.             map.Initialize(0, 25, 0, 25, false, true);
  136.             EEObject pellet = new EEObject();
  137.             pellet.Initialize(24, 24, 9, 0, 19, 0, false, con, map);
  138.         }
  139.     }
  140. }
  141.  
  142. Let's move this object now.
  143. Lets say we want to move the object to the left 1 block.
  144.  
  145. pellet.MoveObject(-1, 0);
  146.  
  147. Or to the right
  148.  
  149. pellet.MoveObject(1, 0);
  150.  
  151. Or up
  152.  
  153. pellet.MoveObject(0, -1);
  154.  
  155. Or down
  156.  
  157. pellet.MoveObject(0, 1);
  158.  
  159. Now we have moved our object around.
  160. We're finally done with our object, and want to kill it.
  161.  
  162. pellet.TerminateObject();
  163.  
  164. The end of the tutorial!
  165. Read the Documentation if you want to learn more about EEObject and use it to the fullest.
RAW Paste Data
Top