1. Home
  2. Docs
  3. Game Factory Documentatio...
  4. Coding
  5. Movement

Movement

Now try replacing the code by this:

  export function onTick() {
    moveForward(1);
  }
  

What do you get? If your answer was runaway slime, you are right! The slime just moves forward infinitely:

The moveForward API call moves the actor forward with the given speed. In this case we required a speed of 1 meter/second.

So what exactly does forward mean? Well, it’s the direction the slime is currently looking.

To be more precise, we need to do a quick intro to coordinate systems (also called spaces).

How can we help?

Search this website Type then hit enter to search