Rolling my own platformer (teaching a class about c2)

0 favourites
  • 12 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • Hi everyone,

    So I have a Boston area class on Construct 2 that I'm giving. It's going to be a two hour crash course. I got a request to do a platformer and funny enough, of all the games I've made with C2, I've really not done much with platformers.

    Now I know how to do it for the most part with the traditional platformer behaviors and what not, but I wanted to really teach the class how C2 works without relying on premade behaviors. I want to take them through each of the steps of how the platformer is working..

    I checked out various tutorials out there, but they all seemed to rely on the platformer behavior. I'm also personally fond of building any game with basic components for greater control, so this is for me as much as the class and for anyone else who wants to control player movement better.

    I'm thinking something like a straight Super Mario platformer. I've already made a bit of progress on this. I have a guy jumping, you can see here http://part12studios.com/temp/platformer/ so here is the trouble i'm having:

    1. how to slow a guy down? I'm seeing that I can make a guy accelerate with no problem.. but then turning around becomes fight against momentum and also releasing a keypress results in unreliable deceleration

    2. how do i max movement. I tried some ways of monitoring velocity, but wasn't finding a good way to regulate velocity when things were going too fast.

    3. I used physics, but maybe doing a more controlled platformer is better using some other method to jump and such?

    Any advise / tips on this would be really helpful!

    Thanks

    Caleb

  • You don't want to rely on behaviours, but you are using the physics engine?

    ok..

    Would it work to set velocity to zero on key released or something like that?

  • LittleStain well doing something that drastic would have really sudden stopping.. i'm looking for some easing to stop.

    yea it's just so i can show someone new how to construct interesting interactions.. and i think that showing them exactly what is happening will be a useful tool in building a game for them.

    also looking at the platform behavior.. they have a Max Speed. I'm wondering how that could be achieved. and max Fall Speed.

    here is the capx I have so far https://dl.dropboxusercontent.com/u/699 ... 0test.capx

    also like i was saying with point 3.. I'd be very interested in knowing how it could be done without physics, it's just the only way I would know how to do it, but at the same time this is going to be for beginners so I'm not trying to blow their minds with complex math equations.

    I'm trying to show how someone could get creative with Construct.. maybe explore double jumping, wall climbing perhaps. etc

    Thanks!

    Caleb

  • newt thanks for the link but my question is specific to Construct 2 and how to achieve a smooth slow-down, not game design in general.

    If anyone has any pearls of wisdom on this, I'd love to hear your thoughts on it. However I think for times sake, I might go ahead and use the platformer behavior..

    I just found it to be useful when I was working on my box flicking game, to not use the drag and drop feature. It wasn't a lot of extra work but it allowed me to have better control over what happens when exactly.. which is the point, but i think the platformer behavior is pretty robust which is nice.

  • Would this work for you?

    Doesn't work while jumping right now, but with som extra conditions this should work for a gradual slowdown, right?

  • LittleStain yes that's nice so i see that 0 doesn't stop it, it still slows down gradually which is perfect.. i did some testing before but it seemed like it was much more drastic when I did it.. i must have been doing something different.

    jumping is weird.. but i'll do some more testing.. the other big thing is how to keep it from getting perpetually faster.. my attempts to throttle it make it very choppy..

    Thanks for your help on this subject!

  • You could set a limit to physics.velocityX

    like this:

  • If you scroll down that page you'll see a whole section on platforms that includes several studies, and formula on what you are doing.

  • LittleStain so the way you're doing it is every time the velocity hits 750 either way, subtract 100.. then i take it it just keeps going back up to 750, repeat.. that's cool. feels pretty steady from the testing I did

    newt ok cool yea that is nice. thanks! I'm bookmarking this sucker for deeper research for sure. I'd like to better understand the subject for sure. This class won't be that deep yes some real understanding of the math/theory behind solid platformer design would be really good to research before doing a serious project.

  • I don't take 100 away..

    I just say that when that velocity is reached no further force is applied..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ah right now i see what you mean.. yes so basically force just hovers right at 750.. + or - very cool.

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