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

Wednesday, July 6, 2011

Not much done today

I had a busy day today, so I didn't get much done. You now automatically "look" when entering a new room and I began to comment my code so I would remember what it did later. That's all for now.

-Dash27

Tuesday, July 5, 2011

aMAZEing!

Yes, it's a horrible pun.

But now I have walls and have built a maze. A few hours well spent.

Note to self:
  • Comment your code!!!

Gettin' Started

Heya-

Don't know what this is or what it will be.

This past Saturday, I picked up "Beginning C++: Through Game Programming, Third Edition." I've taken a Java course and a .Net class before and am learning some code at work, so I thought I'd try to create something.

During my .Net class at BCC, I made a game called Battle2! It wasn't that fun, but was silly and functional. Now I'm working on something else. Right now I'm thinking of it as Battle3, but it could turn into something completely different.

Anywho, after a couple of hours of work I did this weekend, Battle3 consists of walking around a grid and looking around. Each co-ordinate on the grid represents a room. If you get to 0,0 on the grid, the game ends. There aren't any walls or whatnot yet, so it isn't very challenging.

Here are my current development goals:

Movement:
  • Add walls to the grid.
  • Add a description to each room.
Inventory:
  • Add ability to pick up and carry items.
  • Add ability to drop items in rooms.
That's all for now!

-Dash27