Skip Navigation Links

Menu:
 Game Start Page This presents the idea for the game, and starts the process of discussing the code of the random level generator.
 Rooms Data File - dgnRooms.py - stores the room configurations.
 Level Creation File - dgnLevel.py - creates a faux matrix, (it is really just a list), creates tunnels with random places designated as rooms, inserts the  rooms, then places the matrix into the dungeon.
 Tile Creation File - dgnTiles.py - This file creates the panels used as walls, ceilings, floors.  Both ceilings and floors are just one big piece, which optomizes performance.  This file works with dgnDungeon.py to create the dungeon.
 Dungeon Creation File - dgnDungeon.py -  Creates the dungeon using the dgnTiles.py file, each wall is created based on its orientation, which speeds up the building of the dungeon.
 Player Creation File - dgnPlayer.py - Creates the collision box, camera and spotlight.  The camera and spotlight are parented to the collision box.  The player is placed at a random position in the dungeon.
 Player Logic File - dgnLogic.py - Creates the controls for the movement of the character within the dungeon.  These are logic bricks, but are created via python code.
 The Main File - Archeus.py - This is the main file that runs all the other modules; this page also contains the file downloads.
 Geo - This is just a general purpose file I created, it is required, but I consider it to be an all-around utility file rather than part of the game, but you will find some usefull functions here.
 This code Copyright 2014 by Shawn Irwin. Anyone may use this code for any purpose as long as you give the author credit for his work.


Level Creation File - dgnLevel.py - creates a faux matrix, (it is really just a list), creates tunnels with random places designated as rooms, inserts the  rooms, then places the matrix into the dungeon. This code Copyright 2014 by Shawn Irwin. Anyone may use this code for any purpose as long as you give the author credit for his work.

The first order of business in this module is to create a class, Matrix.

Image not available

Next, I have a bounds checker function, that makes sure any operation is legal within the matrix.  This is really only looking for violations on the x-axis, as the y-axis is prevented from overrunning by limiting the random values to (second row,   (len(matrix) - row width)). 

No image available


Th following procedure tunnels through the matrix.  It may look large to you, but half of it is just initializations.  This procedure also leaves markers every so often to designate room locations. 

Image not available

We now have a function setRoomMarkerInArrayIfWithin_WxH_Bounds . . . . That's a long name, but, I consider it important that descriptions are thorough, because if you have to go back over the code later, you have at least a beggar's chance of being able to understand what you are doing.  The said function just makes sure that rooms are not to close to the edge.   The last function copyRoomIntoMatrix, does exactly what it says.  It has a function to prevent overlap, but I have not tested it, so it is commented out, use it at your own risk.

Image not available

This last function is strictly for testing purposes, this draws the matrix in the console, but heed  the warning!

Image not available


Image not available



Copyright © 2012-2017 by TachuFind Color Master