What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Aug 25, 2008 by selsine
Labels: Featured
GeneralInformation  

#General information

Introduction

Dodger: A simple 2D level editor.

Dodger is a simple 2D level editor written in Python. It is designed to be easy to use create level files that are easy to work with in your game.

Requirements

Development

If you want to test this out you can use zc.buildout. Before you do this you need to have PyGTK installed. Then you can run:
python bootstrap.py
./bin/buildout
./bin/dodger
If you already have all of the dependencies installed then you should be able to simply run:
python launcher.py

Installation

python setup.py install

Once it is installed you can run:

dodger

to launch the actual editor.

Usage

Creating a project

When opening or starting a dodger project dodger expects there to be a directory at the same level as the dodger project named "content". That is the directory where your sprite images should be. For example when opening: /home/user/projects/level1.dgr Dodger would expect there to be:

/home/user/projects/content The images in content must be of type .png or .jpg for now. This will change and grow as time goes on to be whatever is supported by PyGlet. But for now it's .png or .jpg

Adding sprites

To add a sprite select the sprite in the "Content List" on the right side of the GUI. Then using either the "Normal" mode (cursor in the mode list on the left) or the "Paint" mode (paint-brush in the mode list on the left) you can add the sprite to the level.

Removing sprites

Change to the "Erase" mode (eraser icon in the mode list on the left) and then click on the sprite that you want to remove.

Interacting with sprites

Change to the "Normal" mode (cursor icon in the mode list on the left) and ensure that no image is selected in the "Content List". If something is selected simply select around an icon in the "Content List" to remove selected. Then you can click on a sprite to select it. Or drag-select to select multiple sprites. Sprites can then be dragged around the screen using the mouse or with the arrow keys.

Adding attribute

You can add or remove any attribute that you want from a sprite or multiple sprites. Simply select it and then press the "Add" button under the attribute list to add an attribute to the sprite.

Removing an attribute

Only certain attributes can be removed from a sprite. To remove an attribute select the attribute in the Attribute list and then press the remove button.

Changing an attribute

To change an attribute select the attribute and double-click in the value column. If the attribute is editable you should be able to edit the attribute. Then type in the new value that you want.

The Main Idea

The main goal of the dodger editor is to create a file that will represent a level in your 2D game. The level that you create will look something like this:

info: {background_image_file: /home/selsine/Projects/Editor/TestProj/content/Background.jpg,
  grid_height: 16, grid_width: 16, height: 480, project_dir: '''/home/selsine/Projects/Editor/TestProj''',
  width: 640}
sprites:
- {height: 16, image_file: monster.png, width: 16, x: 96.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 128.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 176.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 224.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 272.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 336.0, y: 368.0}
- {height: 16, image_file: monster.png, width: 16, x: 416.0, y: 368.0}
- {Gun: BFG, Life: 100, height: 16, image_file: ship.png, width: 16, x: 256.0, y: 144.0}

Then your game will read in the level file and create the level accordingly. Your game will know what to do with any new attributes like "Life" or "Gun" that you add. They don't mean anything to Doger, but to your game shey should mean something.

Contact info

Mark Mruss <selsine@gmail.com>


Sign in to add a comment