You are on page 1of 10

C# Slayers

Zbynek Dusatko (dusatko)


Tommy Hanks (hanks)
John Reed (johnr)
Jared Rose (jrose)

Project Description
We will be designing a 2D level editor in C# that will allow a user to generate, save,
and load maps in XML. This will then allow the user to parse the generated map file
into their specific game to lay out the various aspects of their map in their game. Each
map will be composed of a variety of entities, and each entity will hold a list of
important properties and values pertaining to that entity (i.e. position of entity,
texture applied to the entity, etc.).

Actors and their roles


User: Person using the level editor.

Use cases

Actors: User

Handle Map Package

Use Case: Create a new map


Description: This occurs when the user indicates they desire to start a new map
Precondition: The System is up and running
Basic steps:
1. User indicates they want to create a new map
2. System asks user to enter size of map.
3. User enters map size.
4. System generates blank grid and displays to user.
5. System Autosaves.
Exception:
After step 2: If user indicates they want to cancel.
a. System clears information and resets.
Use Case: Save Map
Description: This occurs when the user wants to save a version of the map.
Precondition: Map has been created.
Basic steps:
1. User indicates they want to save map.
2. System asks for name and location to be saved at.
3. User enters name and location.
4. System saves map at indicated location with indicated name.
Exception:
After step 3: If map name and location already exists.
a. System asks if user would like to save over existing file.
b. User indicates yes.
c. System saves map.
Exception:
After step 3: If map name and location already exists.
a. System asks if user would like to save over existing file.
b. User indicates no.
c. System doesn’t save map.

Use Case: Load Map


Description: This is what occurs when the user wants to work with an existing map
Precondition: System running.
Basic steps:
1. User indicates they want to load map.
2. System asks for name and location to be loaded from.
3. User enters name and location.
4. System loads map at indicated location with indicated name and displays.
Exception:
After step 2: If user indicates they want to cancel.
a. User indicates they would to cancel loading.
b. System returns to display

Use Case: Resize the map.


Description: This occurs when the user indicates he wa indicates he wa
Precondition: The map already exists and is loaded
Basic steps:
1. User indicates that he wants to resize the map.
2. System asks user to enter size of map.
3. User enters map size.
4. System resizes the map and displays to user.
5. System Autosaves.
Exception:
After step 2: If user indicates they want to cancel.
a. System clears information.
Use Case: Modify the grid properties.
Description: User wishes to modify the grid properties
Precondition: The map already exists and is loaded
Basic steps:
1. User indicates that he wants to change the grid properties
2. System asks user to change properties (scale, on-off).
3. User enters or leaves the properties.
4. System Autosaves.
Exception:
After step 2: If user indicates they want to cancel.
a. System clears information concerning the grid properties.

Use Case: Undo/Redo


Description: User wishes to undo or redo changes.
Precondition: The map already exists
Basic steps:
1. User indicates the he wants to Undo/Redo
2. System Undo/Redo
3. System Autosaves
Exception:
After step 1: If there are no more steps autosaved
System does nothing

Handle Entity Package

Use Case: Adding entity to map.


Description: User wishes to add an entity to the map.
Precondition: Map has been created.
Basic steps:
1. User selects and places entity onto the map.
2. System places the entity and draws it to the display.
3. System asks user to enter entity property values.
4. User enters entity’s properties.
5. System Autosaves.
Exception:
After step 3: If user cancels entity placement.
a. System removes entity from map.

Use Case: Create new entity.


Description: User wishes to create a new entity.
Precondition: Map has been created.
Basic steps:
1. user indicates that he wants to create a new entity
2. systems asks the user for the type of properties the new entity will have
3. user enters the type of properties
4. system creates the new entity and makes it available.
5. System Autosaves.
Exception:
After step 2: If user cancels entity creation.
a. System cancels the entity creation and returns to the map display.
Exception:
After step 2: If entity already exists.
a. System indicates to the user that the entity already exists and asks the user
to enter a different entity type.
b. Continues to step 2

Use Case: Modify entity properties.


Description: User wishes to modify an entity's property.
Precondition: The entity already exists
Basic steps:
1. The user indicates that he wants to modify existing entity.
2. System asks user to enter entity property values.
3. User enters entity’s properties.
4. System Autosaves.
Exception:
After step 3: If user cancels entity placement.
a. System removes entity from map.

Use Case: Delete the entity


Description: User wishes to delete an entity.
Precondition: The entity already exists
Basic steps:
1. The user indicates that he wants to delete existing entity.
2. System asks user to confirm.
3. User Confirms.
4. System removes entity from map.
5. System Autosaves.
Exception:
After step 2: If user doesn't confirm deletion.
a. System returns to display without deleting entity.

Handle Group Package

Use Case: Group entities


Description: User wishes to group several entities
Precondition: The map already exists and have more then 1 entity
Basic steps:
1. User indicates the he wants to group entities by selecting them
2. System asks if selected entites should be grouped together and offers to name
the group
3. User enters the name of the group
4. System Autosaves
Exception:
After step 2: If User cancels the grouping action
a. System stops the grouping action and returns to the map view
Exception:
After step 3: If User names the group the same name as another group
a. System indicates that the group name already exists and asks the user to
submit a new name
b. User enters a new group name
c. Continue with step 4

Use Case: Ungroup entities


Description: User wishes to ungroup an existing group of entities.
Precondition: The map already exists and have at least 1 group
Basic steps:
1. User indicates the he wants to ungroup group by selecting it
2. System asks if selected group should be ungrouped
3. User confirms
4. System ungroups the group into its entities and deletes the group name
5. System Autosaves
Exception:
After step 2: If the User cancels the ungrouping action
a. System stops ungrouping action and returns to the map
Use case diagrams

Package Overview
Map Package - Detailed
Entity Package - Detailed

Group Package - Detailed


External Requirements

Level Editor Interface

The Level Editor will have features such as:


1. A menu bar including the ability to turn on and off snap to function and the
grid itself, load and save, and Importing of entities
2. It will have a toolbar with a palette of premade entities and textures. It will
also include a button or link to create a new entity.
3. When an entity is selected it will display properties and allow them to be
edited.
4. When a new entity is added it will allow user to indicate desired properties.
5. Entities are added to the map by click and drag method.
6. Changing layers is taken care of by changing z-coordinate property of entity
7. The editor will autosave after every change.
Conceptual Idea of Entity Inheritance Within a Game