Tuesday, September 30, 2008

KeyListener

Well, I haven't added any new features really, but I have managed a crude implementation that outputs the game to a JTextPane. It's a bit silly and is set to autoscroll, (I haven't quite figured out how to clear the stupid thing each round), but the use of these frames and such allowed me to implement KeyListeners, which I am VERY excited about. I now can just hit keys quickly and it updates from my commands. No more using "keyboard.nextInt()" and having to hit enter after each command. If anyone knows an easy way to clear a JScrollPane with a TextPane inside of it, please let me know.

Monday, September 29, 2008

Due to an entire weekend of relatively unplanned apartment-moving, I've not done much with the code. I have, however, set it up such that if a unit is moved off of the screen, the screen will center on it. I plan to change this, once I implement LOS, this will govern when the screen gets recentered.

Friday, September 26, 2008

A little bit more exciting



So, I fiddled around with it a bit and I now have it to the point where tabbing through squad members changes the focus... the vieport snaps to wherever that unit is (and tries to center on it), also, whatever unit is active shows up as a different character. Also, it now costs time units to move around... to move up/down, left/right costs 4 and to move diagonally costs 5 (which is less than the square root of 32, you know, Pythagoras, etc.) The TUs get depleted as each unit moves around and once the TUs are gone, the unit is frozen.

Thursday, September 25, 2008


So, slightly more exciting. I've got it generating a variable number of player characters. They also now properly move around (under user control) and you can tab between then. I've realized that my data structure is quite cumbersome, so I'll probably re-impliment part of it over the weekend using a better structure and such... it works fine now, but it's a big pile of spaghetti... which will easily become unmanageable as I add more things to it. Also, I need to learn how to set up some sort of CVS system or something. Also, you can't tell from this screen, but I have a variable-sized view-port that properly scrolls around (with prompting, of course) such that the level map could be something like 200*200 and the view-port only 25*25, and you could scroll around to see whatever parts of the level you wanted.

Only midly exciting

So, nothing too exciting yet. I'm in the middle of incrementing some very rudimentary things. Here's a simple screen shot of my progress so far. Hopefully by tonight, I'll have multiple units that can each be moved and also tabbed-through (picture playing X-Com and tabbing through your squad members)

Wednesday, September 24, 2008

Scrolling

I was just experimenting a bit and I wrote my first few lines of code. I now have a few classes, (Main, Display, and World) basically, World keeps track of a char[][] array that contains some randomly generated characters. Display keeps track of the view-port location, which can scroll freely around to view the char grid using some simple input commands. (the size of the view-port and World array can both be adjusted, for example, I had a 25X25 World array with a view-port of only 10x10, which meant that if I 'scrolled' around, i could only see a 10x10 square portion of the entire world at one time. Nothing big, just a fun bit of experimentation. :-)

Seriously... an X-Com Rogue Like.

Oh, I'm writing this in Java using Eclipse... which I know won't be as powerful if I were to write it in c++ or some-such, but, I'm the most comfortable with Java, so, this is what you/we/I get.

First!

So, I'm an undergraduate computer science senior at Eastern Michigan University. I hope to use this place to post about my various personal projects; most of which will be programming related. Hopefully, some people will stumble across this and offer input and insight into the things I am doing.

Some things that I've been thinking about recently:
1. a Rogue-like game based heavily on Micropose's X-Com Ufo Defense
2. a terrain simulator, including such things as water and wind erosion, weather, fluids, tectonic stress, etc. (which could be used to generate and evolve interesting landscapes for various uses)

I have a livejournal page at Livejournal and my personal web page at my university.
I'm also on Facebook and AIM. Message me if you wish to contact me at either place.