Ranged combat kinda working, and cheats

posted in mousetails RPG
Published June 10, 2015
Advertisement
I was not looking forward to doing the re-structuralization required for making ranged combat work, so I made a cheat system first.
In the process, I found some bugs in the way the game decided when to redraw the screen. To be exact, the screen was redrawing every frame instead of only when changed. The problem was in the first write of the speed system, the players update returned a tuple: Should the screen redraw and should the monsters update. In the new system, world updates are handled completely separately, and objects update should return only a boolean whether to redraw the screen. In python, a tuple is treated like "True", so the screen redraws every frame. (Update function is means for things that need to happen every frame regardless of the rest of the world, so it can be used for switching animation frames or something)
I also in the process made some bugfixes in the console system. The textwarp tool I used removed spaces at the end of lines. In my cheat system, this took out all spaces since I put them at the end of the last line, then reformatted it into a new line, causing every space to be at the end of the line at some point, where it would be removed. I found a way to change this setting. I also added the feature to take out the last character before a \b allowing backspaces to be handled correctly.
The main thing I did, however, was the cheats system. Right now, you press capital C, then type in a cheat code, and stuff happens. I have two codes right now, and you'll have to guess what they do from the screen shot. (It's really obvious really). The complicated part was showing what the player was typing in the console, including the backspaces and stuff. I ran into a lot of bugs in the console system, like I outlined above.
Ranged combat is working kinda. I went with the model of having body inherit from a class with just the combat method. I can throw daggers, and kill stuff, however, the accuracy penalty means that its not really worthwhile until you reach like level 6 accuracy. The messages are also wrong, showing "You miss the lizard" instead of "The dagger misses the lizard" I also need to program effect of throwing other things e.g. potions.

Don't forget to check out my code at:
https://github.com/mousetail/Mousetail-s-roguelike
Previous Entry I'm stuck
1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement