Player Creation File

The 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.

Create player with a spot light, camera, and collision box, parent everything to the collision box, place the player in the dungeon. This is one big function, so if you are stickler on programming procedure you may want to break it up. My personal philosophy on this is that I can speed-code this way, and, if I start getting into trouble where things are not working like they should, I start breaking things up into smaller functions . . . . as you see in the level building file. Note that some of the lines here are indented wrong for python, that is just because I needed to keep the JPG image file width down to fit on the web page.


Image not available


You will see tutorials on the web that take quite a long time to do all this . . . gotta love having coding experience, write it once, your done. Need to modify it? No problem.

Image not available

Look at the WHILE statement below . . . I'm not sure there is a more efficient or formal way to do what I am doing here . . . but it works, you just have to be mindfull that True and False do not quite work as you would expect here.

Image not available