Keep jumping when hitting a solid

For questions about using Classic.

Post » Wed May 25, 2011 3:12 pm

Hey everyone,

Currently, when my character hits a roof (solid) his jump is ended immediately and he falls down. Is there a small option that allows me to finish the jump (ie don't fall down immediately) or do I have to create this ability myself?

If you don't know what I'm talking about, I can recommend to play this game: http://www.kongregate.com/games/Arkeus/diamond-hollow

It's a great platformer with very good gameplay. On of the things is that, when you hit a platform, you don't fall down immediately and can still move in the air. This allows the player to have more control over the character and improves the playability a lot.

(I've learned a lot of small things by playing this game, I can really recommend playing it!)
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Wed May 25, 2011 4:23 pm

For your problem what I would do is create the event for finishing the the jump. I'm not an expert,I just started out using construct so I don't know all the options. If you haven't done this tutorial about platforms yet, it may be useful:

viewtopic.php?f=8&t=8913&p=68858&hilit=platform+school#p68858

PS that game in kongregate looks cool, thanks for sharing. :)
B
1
G
1
Posts: 4
Reputation: 433

Post » Wed May 25, 2011 5:25 pm

Muurtegel, I've never experienced the problem that you're having so I'm not sure what's going on there. Are you using Platform Behavior or your own events?

When I make a sprite with Platform Behavior and jump into the ceiling, I don't fall straight down and I am still able to maneuver the sprite as it falls.

Or perhaps I'm not understanding the issue correctly. Could you post a .cap showing the problem that you're having?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed May 25, 2011 6:27 pm

[quote="deadeye":2g4h6qfq]When I make a sprite with Platform Behavior and jump into the ceiling, I don't fall straight down and I am still able to maneuver the sprite as it falls.[/quote:2g4h6qfq]

I'm pretty sure he wants the sprite to push against the ceiling until the jump is over and the sprite starts falling.
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Wed May 25, 2011 6:53 pm

Thanks Lunar, will think about it. I don't have a lot of time until the deadline though (and it sounds pretty hard).

[quote="inkBot":37r3b34g][quote="deadeye":37r3b34g]When I make a sprite with Platform Behavior and jump into the ceiling, I don't fall straight down and I am still able to maneuver the sprite as it falls.[/quote:37r3b34g]

I'm pretty sure he wants the sprite to push against the ceiling until the jump is over and the sprite starts falling.[/quote:37r3b34g]

Yeah that's it. It's easier to jump to other platforms in a small space that way.

If it's too complicated, I'll just have to live with the way it is right now.. I was just wondering if there was an easy solution to this..
B
2
S
2
G
1
Posts: 109
Reputation: 1,068

Post » Wed May 25, 2011 9:44 pm

Okay. I was a bit confused. I thought that's what you meant at first, but the game you linked doesn't do that. Maybe it's hard to see because the bottom part of the platforms overlap the player.

Anyway, you could create your own jump mechanics that do what you need with events. With varying degrees of difficulty, depending on how you do it. You might even have an easier time trying to create your own platforming movement with Custom Movement behavior, rather than trying to finagle the Platform behavior into doing something it doesn't want to do.

If you do make custom jumping it will likely have to be custom gravity as well. I would try making a variable called "VerticalSpeed". When the player just standing there, VerticalSpeed would be at something like 800. When the player hits the Jump button, it sets VerticalSpeed to, say, -400. Or something. Then, every tick you count VerticalSpeed back up towards 800.

Then you can do an Always event where the player's actual vertical speed is set to the VerticalSpeed variable, and jumping and gravity will be handled for you that way.

This would allow the sticking to the ceiling effect that you want, because even if the player hits a ceiling, whatever remaining negative speed you have left over from the jump will still need to run it's course. So the player will continue to move towards the ceiling until VerticalSpeed is greater than 0, at which point he will start to fall.

That's the theory anyway. Good luck :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu May 26, 2011 12:57 am

[quote="deadeye":7j28ff2r]Okay. I was a bit confused. I thought that's what you meant at first, but the game you linked doesn't do that. Maybe it's hard to see because the bottom part of the platforms overlap the player.

Anyway, you could create your own jump mechanics that do what you need with events. With varying degrees of difficulty, depending on how you do it. You might even have an easier time trying to create your own platforming movement with Custom Movement behavior, rather than trying to finagle the Platform behavior into doing something it doesn't want to do.

If you do make custom jumping it will likely have to be custom gravity as well. I would try making a variable called "VerticalSpeed". When the player just standing there, VerticalSpeed would be at something like 800. When the player hits the Jump button, it sets VerticalSpeed to, say, -400. Or something. Then, every tick you count VerticalSpeed back up towards 800.

Then you can do an Always event where the player's actual vertical speed is set to the VerticalSpeed variable, and jumping and gravity will be handled for you that way.

This would allow the sticking to the ceiling effect that you want, because even if the player hits a ceiling, whatever remaining negative speed you have left over from the jump will still need to run it's course. So the player will continue to move towards the ceiling until VerticalSpeed is greater than 0, at which point he will start to fall.

That's the theory anyway. Good luck :)[/quote:7j28ff2r]

Thanks for the explanation. I know what you're talking about and how, in theory, it works. I'm going to finish my to do list for the necessary functions first and when there's some time left, I'll look into custom movement behavior.

The game needs to be finished in 1 or 2 weeks, and I still have a lot of work to do so it might get tricky.. Thanks for helping me though! :D
B
2
S
2
G
1
Posts: 109
Reputation: 1,068


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests