4 Directional Behavior that needs Jumping Ability

Get help using Construct 2

Post » Wed Oct 05, 2016 3:07 am

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.
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Post » Wed Oct 05, 2016 7:30 am

Is there a reason you're setting up a platformer character using 8-direction? The platform behaviour covers most of this.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Wed Oct 05, 2016 11:58 am

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.
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Post » Wed Oct 05, 2016 12:13 pm

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?
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Wed Oct 05, 2016 12:28 pm

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.
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Post » Wed Oct 05, 2016 1:25 pm

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
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Wed Oct 05, 2016 9:34 pm

@badmoodtaylor
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.
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Post » Wed Oct 05, 2016 11:51 pm

staleevolution wrote:@badmoodtaylor
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)
ImageImageImage
B
40
S
23
G
11
Posts: 498
Reputation: 10,062

Post » Wed Oct 05, 2016 11:56 pm

staleevolution wrote:@badmoodtaylor
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.
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Thu Oct 06, 2016 12:05 am

@badmoodtaylor and @plinkie
I will give it a shot tomorrow when time allows. Thank you both.
B
33
S
15
G
10
Posts: 93
Reputation: 7,668

Next

Return to How do I....?

Who is online

Users browsing this forum: Phacanu, Yahoo [Bot] and 32 guests