Tuesday, December 29, 2009

2*2 sized units

So, I've spent some time working through my code and making it a bit more robust and less obfuscated. I have a long way to go, but out of this process emerged the possibility for larger-than-1 tile-sized units. (IE, tanks or whatever) As of right now, they are limited to a rectangular shape; there's no requirement for the dimensions to be square.

larger units are properly displayed, properly block light, properly move, and properly check for obstructions. (a 2by2 sized object won't fit through a 1by1 hole)

What you're seeing above is a 2by2 unit. it isn't necessary for a larger unit to be all the same character or color, but this one is like that for simplicity.

The only remaining issue related to this is that I need to figure out what algorithm to use in regards to placing units inside of a ship, or their initial starting positions.

1 comment:

Jotaf said...

Looks great!

You may want to keep them square for moving objects anyway. Otherwise it may be difficult to figure out how to rotate them, especially when doing so would collide with walls or objects! This way you don't even have to model facing.

About unit placement inside a ship, two rows of people (ie, seats) would look real enough? Say you have N guys to place, divide each row in N/2 spaces and place the guys in those spots until all are accounted for... something like that :)