KungFuChowder
Member
I'm trying to code a limit that would make a spaceship drop from warp and stop before it reaches the boundary of the map. The game room has a width and height of 8k pixels. So here's what I'm thinking:
While the ship is in warp it's speed is well over 5 so the first line is just to determine whether the ship is in warp. The second line is me trying to determine whether the x coordinate is over 7500. And if it is, the third line will set the global variable switch "warp" to false. That's part of a complicated system that makes it so the ship will go into warp(shortest explanation). The last line is setting a friction amount to 5. So that's it. The ship should stop once it reaches 7500. But it just keeps going to 8000 and collides with the boundary. Any ideas where I'm going wrong?
GML:
if (speed > 5){
if (x > 7500){
global.warp = false;
friction = 5;
}
}