Dragoony menu screenshot
Dragoony level 2 screenshot
Dragoony level 4 screenshot

Homepage for Informatik IV-Project  SS04

(programming: Lukas Novosad)



The goal was to create a game for the lecture "Informatik IV", no further specifications were given. The project exercise description provides more details.


Requirements document:

The goal of this project is to create an adventure-puzzle game. The inspiration is taken from games like "Zelda", "Sokoban", "Gargoyle", for example. At the beginning, the framework should be kept simple but be extendible in the future; e.g. it will serve as a prototype only, which can be mutated into a full game later on. As the project name suggests, the player character (PC) in the game will be be represented by a dragon. The PC should be able to collect some kind of points which reflect how well the player performs throughout the game. There should also be visual representation of how many remaining lives the PC has. As it is a custom in most games of this type, there have to be some enemies. Furthermore, the PC has to have abilities to interact with its surroundings. This should include actions such as pushing stones or attacking enemies. The view in the game is going to be top-down.

Analysis, Desing, and Implementation (2004):

In order to understand the application design and implementation the reader is encouraged to look at the Eiffel BON diagram (BON stands for Business Object Notation). I started out by analysing the racing game example provdided by the ESDL library. After some time I began to understand how the ESDL wrapper works and started converting the racing example to serve my needs, e.g. from a side-scrolling to a top-down game. The root class is called DRAGOONY which must be a client of ESDL and ESDL_SCENE in order to set the basic settings for SDL and start the event loop. The event loop takes the class START as the first ESDL_SCENE, which represents the initial menu screen for the game offering the following three options: "Start", "Instructions", and "Exit". The last option is used to quit the game, the first option starts the game in the scene modeled by the class ZLEVEL01. The middle option simply displays the intructions screen implemented by the INSTRUCTIONS class. Both START and INSTRUCTIONS are effective descendants of the deferred class MENU which serves as a base class for all menus. As depicted on the UML diagram (created using ArgoUML) there is a deferred class ZLEVEL which implements the basic functionality of the game and from which each level inherits. It offers several deferred features which create all the different objects for each level individualy. Each descendant must implement these features, which include the creation of walls (create_walls) or the creation of aliens (create_aliens), for example. The basic level consists of the PC and the surrounding stones only. These are implemented by the effective classes STONE_BORDER_HORIZONTAL and STONE_BORDER_VERTICAL which both inherit from ESDL_RECT_COLLIDABLE in order to be able to detect collisions and from ESDL_TILE_PATTERN_HORIZONTAL or ESDL_TILE_PATTERN_VERTICAL, respectively. The next two classes to be described are STONEFIX and STONEMOVING which, as the names suggest, represent fixed or movable stones in the game. The latter may be moved by the PC by bumping into the stones. Both classes inherit from ESDL_SURFACE and ESDL_RECT_COLLIDABLE. Since our little dragon wants to collect some points, there is a deferred class BONUS and the two classes CHEST and POINT_BONUS are effective descendants of it. The POINT_BONUS class is basically the same one as in the racing example, the other one is new. Because there has to be a way which permits the PC to move from one level to the other a class called EXIT was created. This class inherits from ESDL_SURFACE and ESDL_RECT_COLLIDABLE. If the dragon reaches the exit, the event loop moves to the next scene according to the on_win feature which is deferred in ZLEVEL and must be implemented in each of it children (ZLEVEL01, ZLEVEL02, ...). The next class to be explained is our enemy in the game. The class ALIEN represents an alien and inherits from ESDL_RECT_COLLIDABLE, ESDL_SPRITE, and ESDL_TIME_SINGLETON, which is required to make the aliens move independenty from our dragon. Last but not least the class DRAGON represents our PC. Similar to the class ALIEN it also inherits from ESDL_RECT_COLLIDABLE, ESDL_SPRITE, and ESDL_TIME_SINGLETON.

User guide:

When the application is launched, the start menu is shown. The user has the following options:

- START: launches the game

- INSTRUCTIONS: displays the instructions

- QUIT: exits the application

At the beginning of the game, the player starts with his dragon on the left side of the first level having three lives. The goal in each level is to reach the exit represented by an olive-green door and collect as many points as possible. Currently, there are six levels. The player may move the dragon up, down, left, and right by using the corresponding arrow keys on the keyboard. If the player touches an alien, the alien vanishes but the PC loses a life. Touching any kind of bonus item will collect the points and add them to the player's total score. The dragon is able to push certain stones by bumping into them. Reaching the exit of the final level or pressing the ESC key in any level will abort the current game and the application reenters the start screen.

Developer guide:

The description of the application architecture was done in the "Analysis, Desing, and Implementation" section above. The prototype can be extended by adding more objects, levels, and possibilities of interaction. I wanted the dragon to be able to attack enemies and carry various items, possibly represented by an inventory. But the time given was not enough. Naturally, a whole story with quests and a large dungeon would be very pleasant. Not to mention other types of enemies, especially larger ones (called "Bosses") which require a different, usually more challanging effort . There were some difficulties I encountered. As an example the right stripe of the stones surrounding every level was simply not drawed with a screen size of 1024*768 and I had to change the application's screen resolution. Finally, the frames per second (fps) where quite low at the beginning until I optimized the source code.


Testing was done by playing the game. I did not have any time to construct explicit test cases.


Because I did the project on my own I ended up spending most of the time coding, and thus I wrote a rather short documentation. It should be extended. Furthermore, contracts (preconditions, postconditions, invariants) are incomplete or even lacking in the code and should be clarified. Currently, it is necessary to turn off contract checking not only to hide some of my mistakes, but also to speedup the game in order to be challanging. Finally, I used a lot of the pictures and animations contained in the racing example which came with ESDL library, these should be replaced by own designs.


Technology used for the project:

The game was created in 2004 using EiffelStudio 5.4 and an early version of ESDL (0.3.1), now called EiffelMedia library. Later on, the game was adapted to EiffelStudio (6.0) and EiffelMedia library (1.0 - Blackbird).


Requirements to run the project:

In order to run the executable, a Windows PC which is able to run SDL applications is needed. However, no special graphics HW is needed, nowadays systems should do fine. If you want to compile the project for Linux, you will need the sources and a corresponding Linux distribution of EiffelStudio (6.0) and the EiffelMedia (1.0 - Blackbird) library.



Executable & Sources:

executable -> dragoony_release.zip (1.95 Mb)
sources -> dragoony_sources.zip (4.67 Mb)
BON diagram 2004 -> dragoony.gif (32 Kb) 



Resources used for the project:


Development & Tutorials

Lecture 'Programming in the large' -> http://se.inf.ethz.ch/old/teaching/ss2004/0004/
Exercise description -> project_exercise.pdf (40 Kb)

SDK & Projects

Eiffel Software -> http://www.eiffel.com/
Eiffel games at the ETH Zürich -> http://games.ethz.ch/


EiffelMedia (formerly ESDL) -> http://eiffelmedia.origo.ethz.ch/
SDL (Simple DirectMedia Layer) -> http://www.libsdl.org/