Seing how previous battle never started because noone ever come up with any sort of ready-to-use environment, i have decided to do something about it. In a few hours I am flying away for a business trip, so you will have enough time to play with this stuff, find some bugs in it, discuss improvements, battle rules, judgement procedure etc.
Here’s simple short-term memory no-ai-at-all script to get you started:
if (!this.inHasBullet) {
// no bullet, let's get it
var bulletAt = -1;
for (var i=0; i< this.inColors.length; i++) {
if (this.inColors* == 2) {
bulletAt = i; break;
}
}
// go up until we see it
this.outMoveAngle = (bulletAt < 0) ? 27 : bulletAt;
this.outMoveSpeed = this.inMaxSpeed;
} else {
// look around for enemy
var enemyAt = -1;
for (var i=0; i< this.inColors.length; i++) {
if (this.inColors* == 1) {
enemyAt = i; break;
}
}
if (enemyAt > -1) {
// throw the bullet
this.outThrowBullet = true;
this.outThrowAngle = enemyAt;
this.trace("Throwing @" + enemyAt);
}
// up we go
this.outMoveAngle = 27;
this.outMoveSpeed = this.inMaxSpeed;
}
So, will see you in three weeks.
:rd: