So basically I had AI problems yesterday and I have it today. The Goblin is supposed to attack when the Hero gets to close.
Enemy.onEnterFrame = function()
{
if (Enemy._x - Hero._x >= 30)
{
trace(“ATTACK THE INNOCENT HOMES AND VILLAGES!”);
_root.Enemy.gotoAndPlay(Attack);
}
else
{
trace(“Peace”);
}
}
I think it’s jsut a problem with the goblin animation sequence, but I’m not entirely sure.
My other problem is in a different project of mine. It just doens’t shoot more than one bullet, I shoot once, and if I shoot again my first dissapears and my second one appears at my gun.
i = i+1;
var depth = 1;
onMouseDown = function () {
var b = attachMovie(“bullet”, “bullet”+depth, depth);
depth++;
b._x=MainHero._x, b._y=MainHero._y;
b._t = Math.atan2(this._ymouse-b._y, this._xmouse-b._x);
b.onEnterFrame = function() {
this._x += Math.cos(this._t)*9;
this._y += Math.sin(this._t)*9;