Code:
ffc script Patrol{
void run(){
while(true){
if (this->X == Link->X+8 || Link->X-8) {
this->Vx = 0;
}
if (this->X != Link->X+8 || Link->X-8) {
this->Vx = 1;
}
Waitframe();
}
}
}
What this is supposed to do is move the FFC at a constant speed, stopping if it bumps into link. I have a vague idea of what i'm doing but naturally, it's not working. The FFC moves, sure, but it just zooms right by link.
Before I made some edits the FFC would stop if it was completely overlapped with link. It was odd. I put link against a corner (of solid combos) and the FFC would stop. but it wouldn't stop no matter what otherwise. The lack of intuition to this backwoods game engine will be the aneurysm of me.
This is a WIP script, taking it one step at a time. I don't want this to turn into a 300-line block of code for something as simple as moving a FFC between two points and being wary of link. However, the following behavior is what I'd like to achieve after working on this script some more:
FFC moving between two points (specified with those scripting combo flags).
------ When it reaches that point, the FFC switches combos or tiles. They will be consecutive either way.
Stops moving when Link bumps into the FFC. Resumes moving after he moves away.
I think that's it. I would love to be able to have guards that move between more than 2 points but I don't want to incur the wrath of Zscript. Siiiiiiiiigh. @_@