GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

jump through a platform and then land on it

scitunesscitunes Posts: 4,047Member, Sous Chef
edited November -1 in Working with GS (Mac)
Anyone have any ideas how you could have a platform that your player can be directly under and then jump straight up through the platform and then on the way down land on that same platform?

Comments

  • SDMGSDMG Posts: 280Member
    Hi scitunes,

    you could check the players y-motion if its positiv or negativ (moving up/down) when colliding with your platform...
  • joe_williamsjoe_williams Posts: 50Member, PRO
    You could set a rule up that sees if the player is above or below the platform, and change it from a non- collidable object if the y position is below, and one the player can collide with if above. All you would need is an intiger that's constrained to the player's y position. That's a shot in the dark, but seems sound. Oy?
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    Thanks Guys I'll give that a try!
  • SDMGSDMG Posts: 280Member
    Joseph's solution sounds better ;)
  • KamazarKamazar Posts: 287Member
    I actually like SDMG's solution better. I'm might be wrong about something here, but this is how I see it. If you create a platform, and an actor with rules to detect where it is in relation to said platform, you can only use the platform's actor once, since you can't assign more than one variable to an attribute, make sense? You have to make new actors for each platform you put in a level. SDMG's solution seems simpler and'll work with any and all actors as long as you implement a tag. For example:

    If "player" velocity is less than 0, "platform" (or actors with tag "whatever) is non-collidable.
    Else "platform" is collidable.

    And that's it.
  • SDMGSDMG Posts: 280Member
    thank you kamazar ;) after posting my solution i thought at the possibilty that the player could maybe sometimes jump up but not high enough ... only half through the upper platform for example... so with my rule he would get stuck while his y-motion is getting negative and he is overlapping the upper platform...
  • butterbeanbutterbean Posts: 4,315Member, PRO
    scitunes, did you decide which method to go with, or has anyone tested any of the samples out?

    If so, I'd like to see details on what rules were placed in order to do this, I could use this for my game :)
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    I have not gotten to that point yet. I am currently working on the graphics. I'll repost when I have had a chance to play around with these different ideas.
  • butterbeanbutterbean Posts: 4,315Member, PRO
    Scitunes have u been able to integrate this yet?
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    Sorry, I have been working on my immune system game (which is now up). My next game is going to be a twist on a game I found in the app store called doodle jump in which your player is always jumping and it will be crucial to figure out how to jump through a platform and land on it so I will definitely be experimenting with it soon. I'll let you know how it goes.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    hmmm. I'm thinking this.

    With the jump how to using the thin jumping platform that sits on top of the normal platform, use that with a Rule that says

    Rule: If collides with StandingPlatform
    --Rule: If collides with JumpthroughPlatform
    ---Otherwise: Collide(with instance of StandingPlatform)
  • butterbeanbutterbean Posts: 4,315Member, PRO
    If you just want a platform (regular non-jumping or bouncy), you can still implement it this way?

    You implement these rules within the actor: platform? Or player 1 actor?

    Sorry !
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    the rules are for the jumping actor. You will need 2 types of platform actors. Name them whatever you want.

    You just want to know when you have something to stand on but you are not in the middle of the platform. I'll edit the example above.
  • scitunesscitunes Posts: 4,047Member, Sous Chef
    THANKS!
  • butterbeanbutterbean Posts: 4,315Member, PRO
    So I tested this and it works great except if the player runs into the side of the platform, they will collide with it, but if the platform is high enough, they will go through it and land on it, so right now it only works if you raise the platform high enough for the player not to walk into it :)

    Is there any way of preventing the player from walking into the platform?
  • Stryfe01Stryfe01 Posts: 146Member
    any update on this? I am having a similar issue. The player collides with the side of the platform and it upends my character.
This discussion has been closed.