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

Thursday, July 28, 2011

Doors and Dogs

I added a couple new features over the past few days.

There is now a locked door that requires a key to open. Additionally there is a stray dog that wanders the map. You can't interact with the dog yet, but hopefully soon.

But if you call for him, he'll tell you where he is....

Monday, July 25, 2011

Inventory Works!

Yes!

My genius idea worked! I am now able to pick up an item, move to another location, drop it and move back to the original location without having the item magically respawn.

In order to do so, I had to re-write most of my code, but that's how the cookie crumbles.

The big change I made was to create the rooms during the declaration of variables. Before I was only using an instance of a room when moving. That meant that every time the player left the room, any changes made to the room would be erased and when the player re-entered, the room would look as good as new. (This is why if i took an item, left the room and returned, the item would re-appear.)

In making this change to the rooms, it borked my Moving code, so I had to fix all that. Then finally, i was able to write the Item code.

Phew. That was a good night's work.

-Dash27

Friday, July 22, 2011

Inventory Issues

As I believe I said before, I was on vacation for a week in sunny California. One day when I wasn't relaxing on the beach, I worked a bit on being able to pick up and drop items in Battle 3. I emailed the following update to a friend:

"Ok, so I got Battle3 to where you can pick up an item from a room and the item is removed from the room and added to your inventory. However, if you leave and come back, the room repopulates the item.

Also, if you drop the item in another room, it vanishes.

So, in summary room inventory is broken. "

I continued to work on the problem a little bit, but kept running into issues. [My problem centers around two classes needing to access data and functions from each other. I'm sure it's possible, I just don't know how.]

Anywho, on the way to work this morning, I think I came up with a new way to handle Inventory that is waaaay less complicated than what I was attempting to do. Yay for Zen moments in traffic.

-Dash27