0

I'm working on a terminal window based game using Curses and Python 2.7.12. The game so far is working great, just need to add a basic fight system. However, I got bored with the all white characters on all black. So, I wanted to make the @ sign (the player) red, the H's (the walls) gray, the C (the treasure chest) yellow, and the X's (enemies) blue. However, when I change the color of the characters using a color pair, the inch method doesn't work, like you can walk through the walls and the enemies don't kill you and the chest doesn't end the game, like it should. My code is a little sloppy because it's really my first time doing OOP in Python for real, also, I write most of it during night. Please don't try and fix other things that could be wrong in the code or criticize me on it, I'm just asking for help on this one part. I want to learn from my mistakes (except this one, I really can't figure it out) and re optimize my code on my own. Thank you in advance!

(Note: I am running Windows 10, so make the modifications necessary to make it run on Mac/Linux if any. Note 2: The string named 'map' is the actual map for the game. The reason why it is so long is because it is actually a square of text characters that had all enter clicks replaced with \n. Big map, not my fault.)

Here is the code.

Again, since I do not own a Mac or Linux, I do not know if there are necessary changes needed to make this work. Feel free to do so.

0 Answers0