Endless Runner help

0 favourites
  • 9 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi guys, Im really new to construct and html5 games (used unity, udk, gamebryo before) just doing some research into doing an endless runner type of game on C2 and been searching around for info but couldnt get an answer. I've used bullet to get movement on it but its going from left to right instead of right to left. How can i change its direction without changing the sprites visual rotation?

    Also i've started looking into arrays - would this be a good start to getting random platforms generated (and if theres an example or tutorial that i missed that covers spawning random objects from arrays with attributes applied to them)? In addition to this, how would i spawn these platforms from outside the layout and be destroyed when the sprite completely leaves the layout?

    any help would be much appreciated.

  • To get the bullet behavior to move from right to left change the bullet angle of motion by 180 degrees. I think there is an option to not rotate the object.

    I posted a simple endless runner example awhile back asking for help with the jump. You may find it useful. I just move the scenery back to the other side when it goes off one end, but I wasn't trying to make varying platforms at the time.

    Making player surge towards center of window

    There is another example of a vertical scroller here:

    Vertical scroll platform

    As for using arrays, yes, that's the usual approach, however, since you can easily destroy the objects when they get to the other side of the layout, it isn't strictly necessary. You can create a loop to generate the various pieces of the platform with random properties and set it in motion a certain distance behind the last platform.

    Maybe someone has an example using arrays.

  • Thanks Kittiewan, you were right about the bullet angle being set to off. managed to get them spawning from the right with the system event and create object every x seconds with the choose(value,value) - but it doesnt seem practical (or at the very least im probably not doing it right).

    Tried looking into loops and its confusing me lol are there any example of loops being used to create/spawn random objects out there? (cos i cant seem to find any)

    heres what i have so far (i have 3 platform sprites).

    dl.dropbox.com/u/74839448/runner%20test_platforms.capx

  • I'm planning to modify the bunny example I pointed you to. When a platform passes by a "gatekeeper" sprite it will trigger the creation of the next platform a random distance away. The platform will actually be created of random number of sprites, and at a varying height, and with random obstacles sprinkled over it. When the platform sprites and obstacles reach the other side of the layout, they'll pass by a "terminator" object and are destroyed.

    That's my plan. I think it's pretty standard stuff, but I haven't had a chance to do it yet.

    I modified your example along those lines (but simplified, of course.) One notable difference is that I put the different platform graphics in the same sprite, and then set the frame so I could easily generate random platforms.

    runner test_platformsV2.capx

    I hope it helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks heaps kittiewan! looking over your example now, so far been huge help.

    I notice the jump propels you a certain distance ahead - is there a way to limit this distance?

  • The example I provided above just uses the standard platform jump, and it does move forward. That's why I was working on the bunny example.

    In the bunny example, which was intended for use in an endless level game, the bunny appears to surge forward when jumping (correlated with the scenery speeding up), but then comes back to its original starting place, which is what a game like canabalt does. I don't recall all of the details at the moment, but I think you can adjust the amount of the surge by tweaking the vector x action.

    To sum it up, for a good endless runner, I think you need to make use of techniques from both examples (or their equivalents.)

  • lots of thanks again with this, managed to fix it :)

  • Hiya Kittiewan, nice example! I am specifically interested in hearing more about the random generation of platforms and the way gaps are specified to provide a 'fair' game. Currently I am writing a tutorial for educational purposes, where I try to explain every step of the process. So far I haven't seen many examples without code yet yours seems easy to explain to a class. However, how would you explain the whole "Create object" system action (gaps+width) to a noob-audience?

  • Going to take a look at these later, but I would love to get some info on the putting obstacles on top of the platforms piece... I think I could modify that to allow me to specify a top layer (ground cover layer) in my platforms and also spawn random collectibles above the platforms and/or gaps to give them something other than just the survival aspect...

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