Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Conditional Branches - Facing Directions

Hey guys.

I'm doing this little part of a map, where the player hits an edge and automatically jumps to a piece of land in the middle of water. Then, there's another piece of land in the water, that he needs to jump to. And so on until he reaches the end.

The problem here is that it's not working the way I want it to.

For the first one, I have a conditional branch, saying if the player is facing up, then he will jump 2 tiles up. But then, what's supposed to happen is when you face a different direction, he is supposed to jump forward (2 tiles up) or back, to where he came (2 tiles down).

The problem I have encountered here is that he needs space to move before he reaches the event so the conditional branch works when he faces a determined direction. But what I want to happen is that when you reach that tile, you simply face up (you're already facing up, so press UP again) to move on forward, or simply face back to jump back.

Ideas?
 
I'm a little confused by your description here, but if I'm following you, couldn't you just insert another conditional branch for the player facing down? 

If that doesn't help, would you mind posting the actual event in a screenshot or something?
 
http://img53.imageshack.us/img53/204/usenowuu1.png[/img]
http://img53.imageshack.us/img53/204/usenowuu1.da1a24382e.jpg[/img]

You're in the southern part of the map (down the lake). Those lights represent the events. Like, if you run towards the first event, you will jump automatically to the next one. But the problem, is that when you get the second event (that is actually the same as the first one, only with the "IF player is facing down" different), when you try to face either direction, your player won't jump, because he would need to run a layer first. How do I correct this?
 
What I would do is put the jump events in the water. Since the water is impassable, "Player Touch" (or whatever it's called in VX) will only activate when the player tries to move toward the water.

A different method you could use is changing "Player Touch" to "Event Touch" (again, sorry if the terms are wrong since I don't have VX). This will let the player jump even if they're already on the "Player Touch" tile, although the reaction time will be a bit fast (the player will jump immediately after he lands).

Good luck with it :thumb:
 
You should try something different... lets try a parallel process that tracks the player's facing direction, and a conditional branch using Button Input, and obviously set the parallel process to only be active when "SWITCH" is ON.

Code:
@> Conditional Branch: C Pressed
  @> Conditional Branch: Player Facing Left
    @> Player Jump X-2, Y+0
  @> End
  @> Conditional Branch: Player Facing Right
    @> Player Jump X+2, Y+0
  @> End

...etc, etc, etc...

Also, if the player leaves the designated jump points, back to normal walking areas, you should set the switch to OFF.

I've been scripting too much, so I'm rusty with events, but if the Input seems to be repetitive (like he jumps a ton of spaces), use the Script command on the bottom of the last page of Conditional Branches and use "Input.trigger?(Input::C)". But if its fine, just use the standard Button option instead of the Conditional Branch: Script command.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top