Thursday, April 9, 2009

We have Doors; we also have scrolling!



Ahh, so I slogged through some more code last night. The first thing I did was, using enumerators, allowed for the methods that get game objects' symbols to vary. For example, in this screen shot, the X symbol is the currently selected unit. (The 'R' is a stack of weapons with R (rifle) being the largest in the stack. The X is being returned in this way because I've chosen "getRepChar(AnAgent.RepEnum.SELECTED) or something. This might not seem all fancy and stuff, but it will only take a few lines of code to implement different toggles. For example, a toggle that would switch the terrain display from its normal symbols to perhaps, # or . , depending on whether it blocks walking, etc. Or perhaps, I want to toggle so that each unit is represented by a single digit number corresponding to their health. Basically, this should make it easier to take in large amounts of important data all at once.

Also, we have doors. They open. They close. They cost TUs!!!

And, I was dreading it, but I knew it had to be done. I finally wrote the code that allows for a view-port to scroll around the environment. In the demo picture, the view-port is maybe 10 rows by 20 columns; where the world is 50 *50. The scrolling works perfectly and without bugs, at least as far as I can tell. Also, I wrote a nice little method that attempts to center the view-port on any location, and if you give it a location that would cause it to run off the screen, it fixes that location. This means that when you cycle through your agents now, the screen tries to center on them; and when your guy walks around, the screen follows.

I'll do some more coding today, but I won't be able to code any more until I finish an assembly project that's due on monday for my operating systems class. We're modifying the boot sector of a floppy disk to (at the very least) write a "hello world." bootable OS. Though, most things beyond 'Hello world' will actually score us some extra credit.

Here is a list of things I would like to accomplish before I release my first super-shitty alpha version.

*Stairs!! We need them!
*reformat the HUD so it's actually usable
*allow for easy adjustment of the font size
*Finish implementing the equipment screen
*we need to be able to shoot at things!
*example soldiers should probably (for now) be created already-equipped
*finish random ship placement (basically, I just need to write a method that randomly checks for an arbitrary size/shape of empty tiles to place a ship/house/sidewalk, whatever
*make sure that '?' shows which commands can be used.
*Something to shoot at!! (and something that shoots back?)

2 comments:

Jotaf said...

Nice!! The progress you make everyday makes me feel ashamed! :D That's good. (Maybe I'll start coding now.)

For your assembly project you might be interested in this little tutorial:
http://www.brokenthorn.com/Resources/OSDevIndex.html

It's an excellent read. I thought this subject was boring until I found it :)

abagoforanges said...

Thanks. I think you're the first person to comment here. Luckily, my professor has provided us with some basic code for the boot sector, etc. Most of the project will be for extra credit, if we get past "hello world." I'll look at the link you sent me tomorrow, once I've had enough sleep for things to make sense again.