Difference between revisions of "LevelEditor"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
[[Category:Feature]] | [[Category:Feature]] | ||
− | === | + | === How to use the Level Editor? === |
− | |||
− | + | ==== Placing Objects: ==== | |
− | |||
− | |||
− | + | # Aim the cursor at the place you want to place the object | |
− | + | # Check that the outline is green | |
+ | # Click the left mouse button | ||
− | + | ==== Removing Objects: ==== | |
− | |||
− | + | # Aim the cursor at the place you want to remove the object | |
− | + | # Check that the outline is red | |
− | + | # Click the right mouse button | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | === | + | ==== Saving Levels: ==== |
− | |||
− | + | # Click the 'Save Level' button | |
− | + | ==== Loading Levels: ==== | |
− | |||
− | |||
− | + | # Click the 'Load Level' button | |
− | + | === How does the Level Editor work? === | |
− | |||
− | |||
− | ==== | + | ==== Placing Objects: ==== |
− | + | # Checking the world position of the cursor | |
− | + | # Checking if the grid is empty or not | |
+ | # Instantiating the selected object as child of the "Parent" tagged object | ||
− | === | + | ==== Removing Objects: ==== |
− | |||
− | + | # Checking the world position of the cursor | |
+ | # Checking if the grid is empty or not | ||
+ | # Destroy object in selected grid | ||
− | + | ==== Saving Levels: ==== | |
− | + | # Find all categorised objects using tags (Wall, Sentry, etc.) | |
+ | # Convert them all into a stripped down serializable datatype | ||
+ | # Insert the stripped down data into an array | ||
+ | # Create a LevelData from all of the data arrays | ||
+ | # Use a binary formatter to encrypt the level data | ||
+ | # Save the encrypted data to file | ||
− | + | ==== Loadng Levels: ==== | |
− | + | # Read the data from file | |
+ | # Use a binary formatter to decrypt the data into a LevelData | ||
+ | # Clearing the level by destroying all objects of the "Parent" tagged object | ||
+ | # Building the level by instantiating every object from LevelData as child of the "Parent" tagged object | ||
− | + | [[Category:InProgress]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[Category: |
Revision as of 12:45, 6 May 2021
How to use the Level Editor?
Placing Objects:
- Aim the cursor at the place you want to place the object
- Check that the outline is green
- Click the left mouse button
Removing Objects:
- Aim the cursor at the place you want to remove the object
- Check that the outline is red
- Click the right mouse button
Saving Levels:
- Click the 'Save Level' button
Loading Levels:
- Click the 'Load Level' button
How does the Level Editor work?
Placing Objects:
- Checking the world position of the cursor
- Checking if the grid is empty or not
- Instantiating the selected object as child of the "Parent" tagged object
Removing Objects:
- Checking the world position of the cursor
- Checking if the grid is empty or not
- Destroy object in selected grid
Saving Levels:
- Find all categorised objects using tags (Wall, Sentry, etc.)
- Convert them all into a stripped down serializable datatype
- Insert the stripped down data into an array
- Create a LevelData from all of the data arrays
- Use a binary formatter to encrypt the level data
- Save the encrypted data to file
Loadng Levels:
- Read the data from file
- Use a binary formatter to decrypt the data into a LevelData
- Clearing the level by destroying all objects of the "Parent" tagged object
- Building the level by instantiating every object from LevelData as child of the "Parent" tagged object