[VXA] moving forward

darkspot

Villager
Member
Joined
Apr 29, 2019
Messages
10
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
10
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 Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,618
Messages
977,837
Members
132,228
Latest member
zhengdddddd
Top