nint22/PixelWar — pull request #2 by marzhall (2013-04-29 04:42:04+00:00)
Title: Added Enemy unit colors, created basic AI

The color pallette array has been extended by 4, using a red palette
that uses similar shading to the green palette. All enemy data has been
modified to use these colors, as well as the enemy base; this can be
easily changed back if desired.

Basic unit AI has been implemented; units will stop as soon as there is
an enemy within rage of their hard-coded range multiplied by
pixel-width. This has the effect of currently making it so that units
stop in a spot where their bullets do not hit their enemies, which will
have to be rectified with aiming code. I have commented out a "make me
an enemy" buton which can be uncommented to for testing.

I chose to work with a position-based array for units, splitting by
enemy and user-units; I felt this was both easier to implement and also
more efficient. I foresee two problems: the array is boolean, so if two
units occupy the same space and one moves forward - erasing the position
data of where it was - this may confuse enemy units. This could be
solved with an integer count array, but I'm approaching the Balmer
limit, so I'll leave that to the reader. The other issue is that only
the presence of an enemy is recorded, not a refernce to it; this means
aiming code will have to find another way to aim. However, I think the
basic solution - two arrays based on the X coordinates - is the optimal
one, and wil only need mofications, not rewrites, in the future.
![inProgress](https://f.cloud.github.com/assets/973107/437042/1cbbc51e-b087-11e2-9bf2-5f21c61a1914.png)
![PixelWar](https://f.cloud.github.com/assets/973107/437043/21669e7c-b087-11e2-8cae-14be1f759510.png)