Fall down through Jumpthru?

Get help using Construct 2

Post » Sun Apr 08, 2012 2:52 am

How can I make it so the platform behavior can fall down thru a jumpthru object from above? Like when you wanna jump back down

Ive tried just moving the players position down a bit with sprite Set Y but it doesnt look like the Jumpthru updates that Im now below it again and it should stop bein solid

Anyone figured out a way to do it?
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sun Apr 08, 2012 4:02 am

I'm new to the engine, so I'll try to help you as best as I can with my limited knowledge. Luckily, this is something I'm looking to implement myself in the future.

This may not be an ideal solution, but it works rather well. I'll let you figure out the exact values you want yourself.

1) First, set a height you'd like to use for your jump. This will be important later. It can't hurt to have control of this.

Event:
System - On start of layout - Player - Set Platform jump strength to 600

Your player will have to have platform behaviour, I assume they already have it.

2) The next step is to disable Jumpthru.

Event:
Keyboard - On S down (or arrow down, whatever fits your case) - Set jumpthru Disabled

3) The issue with this is that if you are standing on a Jumpthru when doing so, it doesn't register until you leave it or jump. Which is why you should force a jump.

Adding a new action, to the event in step 2:
Player - Simulate Platform pressing Jump

4) It looks a bit unpolished to jump, when your player wants to fall. It's best to change the jump strength to something low. It will not be visible to the player, but it will allow them to fall through the Jumpthru they are currently on, and the jump is not visible.

Adding a new action to the event in step 2:
Player - Set Platform jump strength to 1

5) This is all well and good, but now all your jumpthru platforms are disabled, and you can't jump more than a single pixel. We need to fix that by making a new event, but we want to set a wait period to allow the player to get through the platform (change it to whatever length you want).

Event:
Keyboard - On S released - System - Wait 0.3 seconds

6) Next we want to re-enable Jumpthru platforms:

Adding a new action, to the event in step 5:
Jumpthru - Set Jumpthru Enabled

7) Now we need to fix the jump, this is where setting a strength in step 1 comes in handy.

Adding a new action, to the event in step 5:
Player - Set Platform jump strength to 600

Here is an example capx:
https://www.yousendit.com/download/M3BubUpUQ0NOMUNFTmNUQwPaulStrife2012-04-08 04:03:06
B
3
Posts: 14
Reputation: 453

Post » Sun Apr 08, 2012 4:11 am

hey thanks for the example! Its not a great solution but it works sure enough! I had no clue there was enable/disable for solid/jumpthru thats damn useful
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Sun Apr 08, 2012 4:15 am

There is another solution covered in this post:
http://www.scirra.com/forum/fall-through-platforms_topic48096_page1.html

I like how there are many solutions to problems in this engine.

My solution had more steps than it should, because the jumpthru being disabled doesn't immediately reflect on the platform you are currently on.PaulStrife2012-04-08 04:16:48
B
3
Posts: 14
Reputation: 453

Post » Sun Apr 08, 2012 4:20 am

Just Press down and you will do a Mario like movement through the top.

Browser Preview
http://dl.dropbox.com/u/65622728/JumpSolid/index.html

and .Capx
.Capx



jumpsolid by N7Effect, on Flickr

I Believe this is easiest way.Erndog2k2012-04-08 04:27:29
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Sun Apr 08, 2012 4:54 am

Heres how I solved it

B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Tue Apr 10, 2012 6:22 pm

I started playing with Construct 2 just yesterday, loved it, and as soon as I learned about jump through, the fall through question came in my head. After seeing a lot of solutions, and learning a bit more about conditions and so, I made up a solution of my own, and I think it works quite nicely.



It's kinda simple. If players is exactly on top of fallthru platform and it's not jumping(I thought it was silly that you could "fall through" while jumping), the platform jumpthru option is disabled, but this will only make a difference when the player leaves the platform, hence the "Set Y to Player.Y-1" action.

And then, I restore the Jumpthru option, but with a little system wait, to make sure gravity pulls down the player enough to fallthrough the platform.

EDIT: Ok, after some testing, some platforms were simply not becoming...platforms, again, I would pass through them like it was nothing. I solved this by doing the actions on the sub-event(7) directly after the actions of the event 6, making sure that no matter what, the Jumpthrough option was enabled again.
samgamgi2012-04-10 18:34:08
B
7
Posts: 12
Reputation: 800


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests