The "Help me with Platform School" Challenge

This forum is currently in read-only mode.
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • I need help! I can't find a good solution to slopes in the new Platform School tutorials. I've been racking my brain for two days on this now. The platform behavior itself navigates up and down slopes just fine. That's not the problem. The issue I'm having is lining the player up with the slopes.

    In the old tutorials, the player and the hitbox were separate objects. That means that if the hitbox detected a slope, then the player sprite could set it's angle, and be moved downward a few pixels from the hitbox, in order to line itself up with the slope.

    Here's the problem: In the new tutorials, I've gotten rid of the separate hitbox and I'm using David's new collision mask feature instead. So... setting the angle of the sprite now also sets the angle of the hitbox, which I have found to be rather glitchy.

    Also, I am using the "Auto Rotate" and "Auto Mirror" features so that the player sprite only needs one animation angle. Setting the angle manually seems to work well enough, but if you're not actively setting the angle then the Auto Rotate feature kicks in and makes the player face where it thinks he should be facing. It's not a bug, since it's working like it's supposed to, it's just an inconvenience.

    So, here's where the challenge comes in. I may just be going about this the wrong way, and someone out there might have a better solution. I'm inviting people to help make the player line up with slopes. Here's the .cap:

    http://dl.dropbox.com/u/529356/slopetest.cap

    v0.99.82

    The solution you create has to fit in with the rest of the tutorials, so there are a few rules. They are as follows:

    • You must use the Charlie sprite as-is. You cannot add angles or change the Charlie sprite, it's hotspots, or it's collision mask. You may add image points if need be.
    • You must use the Auto Rotate and Auto Mirror features.
    • You cannot use any behavior on Charlie other than Platform.
    • I would rather you not use a separate "detector" object. If it's completely necessary to your solution, then that's okay.
    • You may add any families, variables, or attributes that you need. The slope objects already have a custom "Slope" attribute assigned to them.
    • Your solution must be simple enough for a newbie to understand. You can use complicated math as long as you are able to explain it to a layman. (In other words, if I don't understand it then it's too complicated )

    You can use any method you see fit to make running up and down the slopes look natural. I will pick the easiest and best looking solution and incorporate it into the tutorial, where you will get credit.

    With the guidelines I've set it might not actually be possible to do what I'm asking. All I know is that what I've tried hasn't worked. Hopefully someone can find a way, but if not then that's okay... I just won't have slopes in the new Platform School tuts.

    And thanks in advance for the help

  • I would just use a separate detector sprite. While using the custom collision mask may be convenient, for this type of problem, you're making the problem far harder. If you're trying to find an angle and the act of testing an angle changes the collision mask, you're already in an order of magnitude harder problem than using a separate hitbox.

  • I would just use a separate detector sprite. While using the custom collision mask may be convenient, for this type of problem, you're making the problem far harder. If you're trying to find an angle and the act of testing an angle changes the collision mask, you're already in an order of magnitude harder problem than using a separate hitbox.

    Yeah, I'm realizing that a bit too late. The thing is, I've already finished the first few lessons and they're all using the collision masks. It was a bit of poor planning on my part. Live and learn, I guess.

    The reason I switched to the collision masks is because I wanted to show the new feature, and I wanted to make the tutorial as compact and efficient as possible. Using separate hitboxes means extra objects and extra events. I guess missing out on slopes is the trade-off. So I think the best thing to do is just leave slopes out of the main tutorial, and maybe have a separate mini-lesson that shows how to do it the old way. It's not really necessary to have them in the tut anyway, this is Platform School after all, not Slope Academy or Hill College or something.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Would it be very hard to add the ability to at least get some information from the collision mask during runtime?

  • Information like what? I'm not sure what you mean.

  • I kind of got something to look right, but it is more for hills rather than ramps...

  • I don't think you'd even need to rotate the player for slopes. I think the normal method is to simply have the player sprite overlapping the slope slightly without changing angle. It is simple and effective.

  • Hi there,

    I'm a brand new follower of the Construct pilgrimage so bare with me if I make stupid suggestions

    Is it possible to detect a collision of an image point of a sprite? If so wouldn't it be possible to place two image points on the left and right bottom of the sprite and then calculate the needed angle the sprite has to rotate in order not to colide with one of theese points and the slope? I think then the smooth ramping mentioned in another thread would also be possible to achieve.

    Looking forward to learn and create here!

  • Is it possible to detect a collision of an image point of a sprite? If so wouldn't it be possible to place two image points on the left and right bottom of the sprite and then ... rotate ...?

    Yes it is possible, but the hotspots rotate with the sprite so it's not as easy as you might think . I tried this solution and didn't have much luck with it. While it is possible to get a smoothly rotating player, it goes from "simple" to "difficult" rather quickly, and since this is a beginner's tutorial it wouldn't really fit in there.

    Anyway, I'm afraid the slopes were left out of the lesson in question, and they won't be returning. Sorry, but that's just how it's going to be.

    Closing the thread because it's really not needed any more, but thanks to everyone who tried helping out

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