Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[987] Moving Link with script can fail

1 replies · 882 views · Started 18 April 2009

ffc script MoveLink {
void run() {
while(true) {
if(Link->X < 208) {
Link->X += 1;
}
Waitframe();
}
}
}

Let's take this simple "wind" script. It only works if Link is facing right or left. If Link is facing up or down, he does not move.

If I instead change the script like this:

ffc script MoveLink {
void run() {
while(true) {
if(Link->X < 208) {
Link->X += 4;
}
Waitframe();
}
}
}

Now, Link will move regardless of his facing. (I tried 2 and 3, but they were the same as 1. I suspect that 5, 6 and 7 will be the same as 4, etc)

The other thing is that if Diagonal Movement is on, the original script works as intended. That is, you can move him in 1-pixel increments.

My theory as to why this bug happens is that Link is forced on to the 4-pixel grid (a la the NES), unless he's "moving" in the direction he's facing, in which that's okay. With Diagonal Movement off, this is no longer a guarantee (since, moving in two directions at once has to take you off the grid entirely), so it permits the movement.