Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ~~NOTES~~
- The tutorial on how to use EEObject is below the documentation.
- Please read the tutorial first if this is the first time you are using EEObject.
- ~~DOCUMENTATION~~
- EEObject:
- VARIABLES:
- -map - The EEObjectMap the EEObject is using
- -con - The PlayerIOClient.COnnection the EEObject is using
- -x - The X position of the EEObject
- -y - The Y position of the EEObject
- -blockId - The Block ID that the EEObject will place when it moves
- -replaceBlockId - The Block ID the EEObject will place when it moves to cover it's movement
- -blockLayer - The block layer when the EEObject moves to place
- -objectIsAlive - If the EEObject is currently alive
- -objectIsMoving - If the EEObject is moving from one place to another, aka, if it's currently being placed
- -blockPlaceParameters - The parameters that are required to place the block normally. Set null if there are none
- -replaceBlockParameters - The parameters that are required to place the block to replace the old EEObject's block. Set null if there are none
- ~~TUTORIAL~~
- Hello! I suppose you're wondering how to use EEObject.
- Getting started is really easy! First, you need to use EEObject.
- using EEObjects;
- Next, you need to create an EEObjectMap for your EEObject to live on!
- EEObjectMap map = new EEObjectMap();
- Now, you'll have to initialize your map.
- 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.
- +--y1---+
- | |
- x1 x2
- | |
- +--y2---|
- ^^^^^^^^^
- No EEObject can go on the borders, or past the borders.
- Lets say:
- x1 = 0
- x2 = 25
- y1 = 0
- y2 = 25
- Now we have some features we need to be sure of.
- If the EEObject goes past the map, do we want to "Overlap" it?
- 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.
- We also have the "Kill" feature.
- If the EEObject goes past the map, do we want to Kill it?
- Killing is simple. If an EEObject is out of bounds, we'll stop the thread (if it's using a thread) it's using.
- Now that in your mind you have discussed how you would like to do that, do the following.
- If you would like to Overlap, put true, else, put false.
- If you would like to Kill, put true, else, put false.
- In my case, I'd like to kill the EEObject.
- Overlap = false
- Kill = true
- Let's put this together.
- map.Initialize(0, 25, 0, 25, false, true);
- x1 x2 y1 y2 Overlap Kill
- Now we have our map nice and created.
- Let's create an EEObject.
- EEObject pellet = new EEObject();
- We have to initialize it.
- 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.
- x = 24
- y = 24
- The ID of the object I will be using will be 9, for a gray basic block.
- blockId = 9
- The block I want to replace it will be 0, so when the EEObject moves, it'll place "air", or "erase" its step.
- replaceBlockId = 0
- The amount of time I want to wait inbetween placing blocks is 19.
- blockPlacementTime = 19
- The layer the block will be placed on is 0, since I want to place them on the foreground
- blockLayer = 0
- If we want to use threading. Usually a bad idea.
- threading = false
- The connection that will be used to place them is "con", since that is my Connection to EE.
- connection = con
- The map the EEObject will live on will be the one we created! "map"!
- map = map
- We dont want any extra stuff on our block, such as number values or anything, so we'll leave the rest blank.
- Our Initialization function looks like this:
- pellet.Initialize(24, 24, 9, 0, 19, 0, false, con, map);
- x y | | | | | | |
- v | | | | | |
- blockId | | | | | |
- v | | | | |
- replaceBlockId | | | | |
- v | | | |
- blockPlacementTime | | | |
- v | | |
- blockLayer | | |
- v | |
- threading | |
- v |
- connection |
- v
- map
- Now we have created a living EEObject on an EEObjectMap.
- Code so far:
- using System;
- using SystemStuffBlahBlah;
- using EEObjects;
- namespace Program
- {
- class Main
- {
- public static Connection con
- static EEObjectMap map = new EEObjectMap();
- static void Main()
- {
- //Insert connecting to EE code here//
- map.Initialize(0, 25, 0, 25, false, true);
- EEObject pellet = new EEObject();
- pellet.Initialize(24, 24, 9, 0, 19, 0, false, con, map);
- }
- }
- }
- Let's move this object now.
- Lets say we want to move the object to the left 1 block.
- pellet.MoveObject(-1, 0);
- Or to the right
- pellet.MoveObject(1, 0);
- Or up
- pellet.MoveObject(0, -1);
- Or down
- pellet.MoveObject(0, 1);
- Now we have moved our object around.
- We're finally done with our object, and want to kill it.
- pellet.TerminateObject();
- The end of the tutorial!
- Read the Documentation if you want to learn more about EEObject and use it to the fullest.
Add Comment
Please, Sign In to add comment