Rewrote a lot of code AND got light to travel through doorways. I know, pretty awesome right?
Saturday, September 10, 2011
More re-writes
So, the current "game" that I am working on takes place in a suburban home. When I last posted, I had figured out how I was going to create the doors and allow the player to interact with them. This morning, I implemented it all.
Now that a part of a room can be interacted with, I need to be able to relay the current state of the door back to the user. This means that I need to constantly update the room's description to include which doors are open or closed. However, before doing so, I think it's best if i finish the lighting functions first, since this too will effect a rooms description. What the player will see when its pitch black is vastly different than when the player is in a brightly lit room.
So I have also added in the ability to toggle light switches on and off. However, doing so doesn't actually accomplish anything yet.
Before moving on, I think I have to rewrite more code. It seems that this is a common practice lately. I believe that I want to change the way a room object is constructed, somewhat drastically. This will impact movement as well, so that will also need to be rewritten.
Also, I should comment my code. Sometimes it takes me a couple reads to figure out what a section is doing and I wrote the damn thing.
Also also, I am thinking of adding debug/dev tools into the code that can be toggled on and off.
In summary, there's a lot of work to be done before anything new gets finished. Arg.
Monday, September 5, 2011
Updates
Over the past few weeks, I have managed to get my C# code on par with where my C++ code was before the switch. With most of the bugs worked out, I came up with a neat game idea.
Before I began working on this game, I thought that I had most of the code that I would need already done. The player could move around, open doors, interact with objects etc. However, I was mistaken. While, yes, all of these things are true, those functions/methods weren't doing exactly what I needed them to do. Therefore, I am building upon existing code to make it more powerful.
For example, most of this weekend was spent on doors. The old maze/fighting application only had one door and only required a bit of extra code to handle it. This new game has at least nine doors. In order to make my code streamline, I had to throw out the little extra code I used for one door and write a block of code that could be used for an infinite amount.
For a while, if you opened Door A in Room 1 and walked through it to Room 2, that same Door A would be closed in Room 2 despite it still being open in Room 1. But that has since been fixed.
I have no idea of a timeline for this little project. But hopefully I'll continue to plug away at it.
-Dash27
Sunday, August 21, 2011
Moving Right Along
Progress has been made.
It turns out a lot of my code is reusable - except for small things here and there. I've gotten the point where I can navigate a grid of rooms and have walls that block passage. Unfortunately, you are blind at this point and can't see any exits. You find exits only by trial and error.
PAX is this weekend and I get a new computer on TUESDAY, so I probably won't code much after MONDAY. But, maybe i'll find some time somewhere.
-Dash
Saturday, August 20, 2011
Switching Languages
It has been a while since I last posted, and before today, a while since I coded.
I spent a week preparing for D&D and I knew that it would never get done if I allowed myself to get swallowed up in the next phase of coding. I was at the point where it was going to get fun and challenging.
However, I am still not at that point. I have been convinced by several trusted folks that I should switch from C++ to C#. So I ordered a few books online and waited until they arrived. It was pointless for me to code in C++ since I was going to be throwing it all away anyway.
I did, though, spend some time jotting down ideas for what to do next - at least once I get my C# code to the point of my C++ code.
Anyway, I started C# today and basically have a "Hello World" running with a couple of if statements thrown in. So, that's cool. I'll probably work on it throughout the weekend.
Monday, August 1, 2011
Bug Fixes
I had some of my friends play the game and they found a couple bugs that I have since fixed.
The latest version includes the following fixes:
- The message "You aren't wielding a SWORD!" will now display when you attempt to attack with the sword when it IS NOT in your inventory instead of displaying when it IS in your inventory.
- When used, the KEY will now correctly open the North door instead of the non-existent South Door.
- When you are reduced to 0 hit points, the game will immediately end, instead of after your next action.
- NPCs who are dead should no longer try to attack you.
Saturday, July 30, 2011
Combat!
It's sunny outside today, so naturally I spent most of the day in doors. :D
Combat now works. At least, the player is able to attack NPCs. The NPCs can't attack back yet. But, when they die, they can drop loot, which is pretty cool.
The command for attacking follows this example "Attack NPC with ITEM". It took me a while to figure out how to separate all the words into different variables, but a couple find methods and trim functions later and it was working.
I then rewrote it all to make combat more NPC friendly. As I said, NPCs can't yet attack back, but when I get to that, I should be able to reuse a good chunk of code.
-Dash27
Subscribe to:
Posts (Atom)