• entries
    18
  • comments
    12
  • views
    16984

Ranged combat kinda working, and cheats

Sign in to follow this  
mousetail

818 views

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
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now