4 Directional Behavior that needs Jumping Ability

0 favourites
  • 12 posts
From the Asset Store
🙌 Ability Skill UI Sound Pack comes with 115 high-quality sound effects
  • As I'm learning Construct, I'm trying new things. I started a side project where I have the player (with 8 directional behavior) that I switched to 4 Directions, move left, right, up, down scaling a wall. I implemented touch screen controls (I might add keyboard) for the 4 directions.

    I imported sprite animations to jump left, right, and Up. I also put on the screen 3 new touch buttons to function as Jumping Left, Right, and Up.

    The animations have 5 frames each. It's the same sprite at normal size, bigger size, largest size, back to bigger size, then normal size. So the gradual increase in size and reverse looks like jumping.

    Here is my problem: I can't figure out a way to implement it in the Event Sheet. I've tried different things, but was wondering if I have to do some setting as "X set to 20" or something like that to make him move so many sprites over to the left (or right or up) as the animation occurs.

    Any suggestions?

    Thanks in advance.

  • Is there a reason you're setting up a platformer character using 8-direction? The platform behaviour covers most of this.

  • I'm making it a vertical auto scrolling game. Think Flappy Bird, but vertical. The player is always climbing up the wall/rocks/cliff. Plan to implement a stamina bar, so he will have to try and reach a certain object to refill it or he falls. There will be other objects to avoid such as thorn bushes, birds, enemies, etc...

    I guess I could get rid of the 8 directional behavior and give him the platform behavior to see if it works.

    There won't be any platform type objects to stand on, as he is in constant climbing state (think Spiderman climbing up a building with back view, almost like crawling position).

    I also still need to figure out how to make the background image repeat as it scrolls. I have the screen going, but the tiled background (on a separate layer) ends and then he is just climbing on a white background.

  • If it's a character constantly climbing or crawling up a wall then it does make sense to use 8-direction. Either the character will push up the vertical screen, or the character will seem to move up the screen but in fact it is just the background scrolling and you are moving only left to right. I don't understand how the character would jump though. Are you trying to jump on the same spot over an object that scrolls below the player?

  • Some smaller objects will need to be jumped over. Some will need to be avoided by jumping left or right. Some enemies will throw projectiles, and moving left to right or up won't be fast enough so jump will be required. Same with some objects like thin stream mud slide can't be climbed on.

  • What about this:

    Disable user input (however you have it setup)

    Increase movement speed

    Play jump animation

    Simulate input in desired direction

    --

    Return movement speed to normal

    animation to default

    enable user input

  • How do you disable user input?

    How would it look on an Event Sheet?

    I still need to figure out how to avoid collisions with another object. Such as a falling rock and I go to hit jump up, the rock needs to then be able to pass under the player while the player jumps.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • How do you disable user input?

    How would it look on an Event Sheet?

    I still need to figure out how to avoid collisions with another object. Such as a falling rock and I go to hit jump up, the rock needs to then be able to pass under the player while the player jumps.

    You could put the controls in a group and deactivate the group. I usually turn the "Default Controls" to No and event my own controls so I have more control over it. I thought there was an event to set the Default Controls to no but can't find it. But however you have the controls setup you disable it, could be with a variable also. (If left arrow down and ready = true then simulate left. If doing that way just change the boolean ready to no)

  • I still need to figure out how to avoid collisions with another object. Such as a falling rock and I go to hit jump up, the rock needs to then be able to pass under the player while the player jumps.

    You could do an event if player is in jumping state, disable collision on all jump-able obstacles.

  • and

    I will give it a shot tomorrow when time allows. Thank you both.

  • If you are still having issues, consider posting the capx of the current state of your project.

    It will be easier to investigate and provide accurate answers in regards to your project as it is made.

    I must admit that I'm a bit at loss with how exactly you are setting things, and indeed don't understand why you are not making a scrolling lke plinkie suggested.

  • Kyatric

    I made it scrolling, but now my character has to start at the top and instead of scaling up the mountain, he has to scale down due to touch controls (which are on separate layer with Parrallax at 0, 0) not appearing at the start of the game since the window is at the top of the layer. They appear and scroll with the player as long as I place the character starting in the designated window.

    Is there a way to place the window at the bottom?

    I will have to post a Capx after I try a few more things. I also have the player shoot stars when touching a certain on screen button. It spawns about 5-6 at a time so it looks like a snake,. I have to try and fix that and I might hold off on the jumping for now. Thank you and the crew for your time. I'm sure I will be needing it again.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)