Tutorial: Platform School

This forum is currently in read-only mode.
From the Asset Store
Dynamic, heavy and powerful rock themes. 11 music tracks.
  • Thanks SuperV, but I need a way to manage the files.

    Anyway, WHFF is still struggling with their file issue, so I updated the first post with box.net links. They're not direct links, but I can't find another decent host that does direct links :/

  • I could just upload it on my webspace, did that here:

    http://thomasmahler.com/files/construct ... %20school/

  • Thanks but no thanks, Thomas... I need to change the versions periodically and I don't want to be beholden to anyone for hosting. I need control over where they're hosted, and when they change. I already bug Ashley about hosting the files on the site every time I update. And if I can't get in touch with you for whatever reason then you'll have outdated files.

    It's taken care of, for now anyway.

  • Why not just use a drop box?

  • Hi.

    I couldn't understand the cooper-bounce-overlap-timer part (lesson

    Can you explain it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi.

    I couldn't understand the cooper-bounce-overlap-timer part (lesson 8 )

    Can you explain it?

    Sure, no problem

    First off, the reason:

    We don't want the turtles to overlap each other. If they do start overlapping, they won't be able to pull apart, and you will have two (or more) turtles occupying the same space. This just looks awkward.

    Second, the theory:

    So... we need a way to get the turtles to bounce away from each other when they touch. Since we're manually moving the turtles by setting their speed and direction, it makes sense to set their speed and direction to something else when they collide. The easiest way to do this would be to make them reverse direction temporarily. This is where the timer comes in. We want them to only "bounce" away for a short period of time, and then return to normal movement. (If we simply tell the turtles to only move away when they're overlapping, then they will continuously try to push into the turtle in front of them. The timer gives them time to get clear.)

    Third, the practical application:

    In event 13 of the coopBox sheet, we have the overlap condition that starts the bouncing sequence. "coopBox overlaps coopBox." easy enough.

    There is an additional condition that, out of those two turtles, the one that is farthest from the player is picked. This is the one the action gets performed on. The 'bounce' variable is set to 10.

    Event 14 subtracts 1 from the 'bounce' variable every 10 milliseconds. 10 'bounce' multiplied by 10 milliseconds = 100 milliseconds, or one tenth of a second. This is the timer that defines the duration of the bounce, and it gives the turtle enough time to get clear of the one it's overlapping. When the 'bounce' reaches zero, we will return to normal movement.

    BUT - notice that event 13 is always setting the 'bounce' back to 10 as long as the turtle is overlapping... this means that the timer doesn't effectively start counting until the turtle is no longer overlapping.

    To get the turtle to stop overlapping we need to change it's direction. This is done in event 12. Event 11 sets the speed for the turtle when it's moving normally:

    + coopBox.Value 'bounce' Equal to 0
      -> coopBox: Set horizontal speed to coopBox.Value('xSpeed')
    [/code:1vvt5pda]
    
    But in event 12, we check to see if 'bounce' is greater than zero, and if so we reverse the speed:
    
    [code:1vvt5pda]
    + coopBox.Value 'bounce' Greater than 0
      -> coopBox: Set horizontal speed to 0-(coopBox.Value('xSpeed'))
    [/code:1vvt5pda]
    
    The "zero minus value" equation is a way to toggle a positive number to a negative number, and vice versa.  0 minus 5 = -5, and 0 minus -5 = 5.
    
    To summarize:
    1. A turtle overlaps another turtle.  The 'bounce' timer is set.
    2. The turtle timer begins to count down only when it is no longer overlapping another turtle.
    3. As long as the 'bounce' timer is above 0, the turtle reverses his normal direction.
    
    And that's about it.  Hope this helps
  • Thanks for reply. It was very helpful.

    Unrelated with it, I also want to ask about Fancy Pants 2:

    http://www.kongregate.com/games/DrNeroC ... re-world-2

    Fancy Pants 2 is one of the worst platform game I've ever played (Let's say I'm playing platform games till the Commodore 64 era)

    Has a very bouncy gameplay and very hard to play.

    But, I think this game is a good example for making platform games. It has lots of features inside. So, my questions are based upon those features.

    • Walking on curves, game automatically turns your character's angle. In your tutorial level designs, there is only one type of slope and it turns the character's angle 45/135/225/315. So, what can we do make our slopes curvy like the FP2 game? Do we need to create smaller slopes that has wide range of angles between 10-60? When we want a curve slope, we will put 10-15-20-25-30 slopes to level? Or there any other easier method for curvy platforms?
    • Character have some special movements. For example, if you press down while moving, character makes a slip kick. If your speed becomes 0 while climbing a slope, character starts to slip backwards. If you press down while slipping backwards, you start to roll in that direction. These seems easy to put our game. We just need extra sprites for character. Then we just create events like "while xSpeed>0"+"player pressed down"="Start slip kick event". Similar to this, am I right?
    • In SP2 game, there is also "level changing" and "bonus level" features. Will you put something like this to your tutorial? I think Mario style "save points" and Knytt Stories style "save zones" are easy to do for our game. I think it can be done "if player destroyed, after 2 seconds, spawn him in this place, subtract life minus 1". But It will be better if you make a tutorial for that kind of features.
    • I think there is also speed check in curve platforms. If we don't accelerate to maximum speed in high angles, we can't climb to that curve and then slip back. I am not sure if putting similar features to our game is necessary. But it would be good if you put another lesson for this kind features. May be it can be used to make a bike racing game.
  • The reason that Fancy Pants game is so bouncy and hard to control is it's not using a traditional platformer engine... it's using physics.

    It's the physics engine that's also allowing to get the normal for slopes, allowing for smooth rotation of the player when on a slope.

    In my tutorials the slopes are rather limited, yes. But this is not meant to be the end of the road. It's simply a tutorial, not a finished, polished game. The method I (and Drasa) show for handling slopes is extensible... you could take this method and create other angles in the same manner. I'm just offering up the technique, it's up to you to take what you've learned and fill in the blanks.

    As for loops and smooth curves... no, I won't be doing that. Shallow curves themselves are not terribly hard to do, but the platform behavior is simply not designed to handle real curves or loops. That would require a custom engine built from scratch with your own events.

    Yes there will be level changing in a future lesson, but I'm sorry, no there won't be any of that other stuff. The lessons have all been planned out, and for my own sanity I've decided to keep things relatively simple. These are beginner tutorials, after all

  • that fancy pants game isnt bad control at all, and hardly the worst platform game ive ever played. probably one of the most technically advanced platformers ive ever seen, and for a flash game its actually amazing that it was even possible.

    the animation is hella smooth, the character has lots of abilities, and he reacts extremely realistically to his enviroment.

  • first off, thanks deadeye for your awesome tuts

    just as a side note

    the most technically advanced, fun, and just plain awesome platformer I've ever played by far is littlebigplanet for ps3. god that game rocks

  • first off, thanks deadeye for your awesome tuts

    just as a side note

    the most technically advanced, fun, and just plain awesome platformer I've ever played by far is littlebigplanet for ps3. god that game rocks

    ok aside from big-shot high budget games is what i meant. lol

  • have you played lbp though? man it's good

  • have you played lbp though? man it's good

    i have an xbox 360, and that game is the only reason i would consider buying a ps3. so ya i know its good, but it aint worth 400$. id love to play it though, havnt tried it yet

  • Hiya Deadeye,

    I'd just like to say your tutorials (and this program!) are amazing, can't wait for you next tutorial on advanced combat, I'm sure as hell not going to be able to figure out how to attack on my todd.

  • That "Lesson Eight - Intermediate Enemy AI" was really useful, was quite easy to understand and made me realise a few things I didn't know about construct.

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