#Always moving to the right

10 messages · Page 1 of 1 (latest)

hollow atlas
#

You are increasing the y for the right movement...

#

Step event
"if (keyboard_check(vk_left)) {
x -= speed;
}
if (keyboard_check(vk_right)) {
x += speed;
}
if (keyboard_check(vk_up)) {
y -= speed;
}
if (keyboard_check(vk_down)) {
y += speed;
}"

#

that's more like it, i think?

lyric lily
#

speed is a built-in variable that works together with direction, another built-in variable. direction is 0 by default, meaning it points to the right.

#

Which means if you have speed set to 1, you'll always move to the right.

lyric lily
#

No, it has nothing to do with scripts.

#

If you want to use a custom speed variable, name it something else.

#

Like move_spd.

#

Setting speed enables automatic built-in movement.