This will probably be the last release of my summer productivity spurt (well, the productivity will continue, but it will split among some other directions). But it was a big one, hence the need for a 7x version increment. There are two real new features here:
1) OpenID sign-in. Making the game dependent on a Google account is a bit unfair IMO, especially since creating a Google account requires a phone number these days - the anti-privacy policies really are picking up here, I'm slightly sad to see Google going this way (not to mention the inevitable secondary consequences of such actions, like discriminating against non-mobile phone users, a class which I myself was a part of until two months ago). Now you can sign in with Yahoo, Myspace and a whole host of other avant-garde technologically progressive providers!
2) The level editor. It's in the most barebones form imaginable at the moment, editing the raw code of the level (though this is an option which I'll never remove, since it allows you to keep offline copies of your work). I'll make proper documentation for this eventually, alongside my effort to supplant said documentation with a graphical editor - terrain is the first target for that, then classes, then units, then more complex events and never story since the present interface is pretty much optimal for story text already. Here's a quick tutorial - combine with the default new level to understand it.
Classes
A class description looks like this:
soldier {"side":1,"aitype":1,"damage":10,"health":90,"range":1.6,"image":"Soldier.png","speed":0.093,"desc":"","cmult":0.75,"bmult":0.6,"inacc":0}
'soldier' is the name of the class, the things in quotes are its attributes. You can see:
side - the team the class is on, the player's team is team 1, teams 0,2,4,5,6, etc are mutually hostile
aitype - 1 is player controlled, 0 is computer controlled. You can, if you want, make this 2, 3 or 4 (guard, flee, voluntary computer controlled) but if you do that the player can always overrule your decision if he decides he likes it better his way.
damage - self-explanatory
health - self-explanatory
range - number of squares the unit can hit at - 1 covers orthogonally adjacent, 1.42-1.99 all within 1 square, 2.00-2.23 a diamond going two squares out, 2.83-2.99 a square going two squares out, see
here for the highly complex vector mathematics you'll need to do to make those kinds of calculations.
image - self-explanatory. Can be one of the images I use:
> ls images
Archer2.png
Archer.png
Catapult.png
Civilian.png
Dark_Knight.png
Dark_Pikeman.png
Door.png
Enemy_Archer.png
Enemy_Pikeman.png
Enemy_Soldier.png
Evil_Centos.png
Eye.png
Golem.png
grass.jpg
Guardian.png
Horseman.png
Lord_Xandros.png
Mage.png
On_The_Offensive.png
Peasant.png
Pikeman2.png
Pikeman.png
Queen_Madrina.png
rock.jpg
Soldier.png
Warlock.png
Zombie.png
or anything from any URL.
speed - self-explanatory
desc - don't worry about this yet
cmult - how much your unit slows down in combat
bmult - what speed of the maximum your unit can go backwards
inacc - inaccuracy parameter, usually set to 0 for melee, 2 for archers, 3 for catapults. Inaccurate units benefit from enfilade.
As for events, there are four types I'll introduce:
unit (class) (x) (y) - adds a unit to the coordinates. The map is 40x30.
setup (left) (top) (right) (bottom) - adds a setup rectangle. You can have multiple setup zones if you want, although units from one zone will be able to be moved into a non-adjacent setup zone at startup.
whenever AAAtBBB [any other event] - AAA ticks in and every BBB ticks thereafter, perform the event. If you make a whenever trigger a whenever, keep in mind that there are no separate timers - all time is measured relative to the beginning.
when AAAt [any other event] - the one-time equivalent.
That's it for today folks, link here:
vubslasha.appspot.com as usual!