[VXA] moving forward

darkspot

Villager
Member
Joined
Apr 29, 2019
Messages
13
Reaction score
1
First Language
English
Primarily Uses
N/A
I'm making this racing segment, and I want the player to keep moving forward automatically and only change direction with controls, how do I achieve this?
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
I did a skiing segment perhaps like what you're thinking. I don't know how elegant this solution is, but I had an activator event that did this:

1594843112003.png

And then a parallel event that looks like this:

1594843195521.png

That only handles :LEFT; you'd want to make a similar thing for :RIGHT. Note that the above makes the player jump down and left if they can keep moving down (that's self switch 85). Otherwise, it has them move left (self switch 86).

The big script statement is essentially trying to figure out whether the player can move left+down or down+left (so it's a passability check to ensure they don't go into a square that's impassable). The 6 and 8 are directions; they use the numpad values for directions, so (8 = up, 6 = right, 4 = left, 2 = down).
You can tweak all those behaviors if you want something different.

However, when running this the player essentially only goes left or right as I've defined and cannot speed up or slow down. You could, of course, set their speed to whatever to control how fast they go.

Hope this helps a bit :)
 

darkspot

Villager
Member
Joined
Apr 29, 2019
Messages
13
Reaction score
1
First Language
English
Primarily Uses
N/A
I did a skiing segment perhaps like what you're thinking. I don't know how elegant this solution is, but I had an activator event that did this:

View attachment 151480

And then a parallel event that looks like this:

View attachment 151481

That only handles :LEFT; you'd want to make a similar thing for :RIGHT. Note that the above makes the player jump down and left if they can keep moving down (that's self switch 85). Otherwise, it has them move left (self switch 86).

The big script statement is essentially trying to figure out whether the player can move left+down or down+left (so it's a passability check to ensure they don't go into a square that's impassable). The 6 and 8 are directions; they use the numpad values for directions, so (8 = up, 6 = right, 4 = left, 2 = down).
You can tweak all those behaviors if you want something different.

However, when running this the player essentially only goes left or right as I've defined and cannot speed up or slow down. You could, of course, set their speed to whatever to control how fast they go.

Hope this helps a bit :)
Thank you so much, that really helps a lot!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

We are truly intellectuals.
Without using violence without weapons
Our group has as many as 1.3 million people and more than 1 hundred thousand talks.
We gathered in an hour, more than 4.5 Half a hundred thousand



I got a Sword.
I got an Axe.
I got two Swords.
Nothing to see here, just walking with my dog.
I haven’t worked on my game in a while. Tomorrow might be the day.
*squeals* :kaoblush:


I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!

Forum statistics

Threads
104,463
Messages
1,006,477
Members
135,971
Latest member
Akasheee
Top