Quote:
Originally Posted by skillmaster19
That is nice, but it seems a little too complicated for me at the time (im new to gscript2)
is there any basic ways to make a simple baddy?
|
Well it's about breaking it down into pieces...
PHP Code:
function onCreated() {
setTimer(0.1);
}
function onTimeout() {
setTimer(1);
baddyLogic();
}
function baddyLogic() {
if (hasTarget()) {
if (targetInAttackRange()) {
attackTarget();
} else {
if (targetInChaseRange()) {
chaseTarget();
} else {
returnHome();
}
}
} else {
findTarget();
}
}