Loops (Not programming)

Hey everyone,

Would someone kindly point me in the correct direction of how I'd make loops. The loops I'm referring is like roller coaster loops. Every time I search I only get stuff on music loops or programming loops etc. It's very annoying. I'd like a character to be speeding down a hill, hit a loop or two and be on his merry way through the rest of the level. I tried just placing multiple rectangular "floors" while the work to a point it didn't fully and I'm sure there's an easier way to go about this.

Any tutorials, videos, etc?

Thanks
Ben

Comments

  • VGXVGX Member Posts: 796
    edited February 2014
    http://forums.gamesalad.com/discussion/54842/dba-competition-win-any-item-from-dba/p7

    Maybe this will help. Scroll down to the 6th post until you see @DeepBlueApps post with a zip file to download
  • bds62bds62 Member Posts: 31
    Thanks @veiraGames. I guess making them how I was IS the only way lol. At least I can examine and understand the physics better, thank you.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    There is a loop behavior in the nightly build for pro users.
  • SocksSocks London, UK.Member Posts: 12,822
    @bds62
    Thanks @veiraGames. I guess making them how I was IS the only way lol. At least I can examine and understand the physics better, thank you.
    I'd probably generate them using some maths rather than place each section into the scene by hand.
  • bds62bds62 Member Posts: 31
    Thanks @socks. I'll play around and see if I can't figure something out though I'm good at math that seems a bit confusing how it'd work.

    @FryingBaconStudios I'm holding off on going pro until I make my first real game. Still just taking time learning, refining and perfecting everything. I'd like to take no less than 6 or 8 months of learning before working on something for the masses.
  • SocksSocks London, UK.Member Posts: 12,822
    @bds62
    Thanks @socks. I'll play around and see if I can't figure something out though I'm good at math that seems a bit confusing how it'd work.
    For example you could use some trigonometry to plot out a circle made up from lots of rectangular actors ... I'll see if I can dig out an example...
  • SocksSocks London, UK.Member Posts: 12,822
    This one's from an old post, not a circle (they are easy enough to do) but it gives you the general idea.
    Take a look at this project:

    http://www.mediafire.com/?ntwtemcrp58gcvo

    Let the balls fall into the 'bowl' then use the white slider at the top (it only moves left and right) to change the size of the blocks making up the 'bowl'.

    Drag it to the left to make them simple collision points - or to the right to make them into a joined up curve - then pick the ball up and roll it down the sides - obviously the more joined up curve will give a smoother roll and the single points will be more bumpy.

    But if your project is a car racing game then you might only need to prevent your cars from leaving the track so single points might be fine . . . ?
  • bds62bds62 Member Posts: 31
    @Socks, wow buddy I really appreciate that. It also gave me an idea for a future game where you don't know the path ahead of you. anyways, thanks a lot. coding looks very interesting with all the timers in one can't wait to dissect it and see how it all works :)

    Again thank you, can't thank you enough haha.
  • SocksSocks London, UK.Member Posts: 12,822
    @bds62

    Here's another one, same sort of deal, an actor moves about dropping (spawning) little pieces to make up a curved surface - once the line is complete then click anywhere on the screen to generate a ball.

    Link: https://www.mediafire.com/?tpcb51j9fr7rm3v
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    Same deal, but with rough-ground rather than a smooth surface:

    Link: https://www.mediafire.com/?z7kmzo0lwedjwbh

    Obviously you don't need to see the elements that make up the ground / surface, you can just make them invisible and place an image over the top, so - in this example for instance - you might make an image of some rocky mountains that follow the curve.
  • bds62bds62 Member Posts: 31
    edited February 2014
    Any chance you could break the following down so I can understand exactly what's going on?
    50*sin( self.Time *150)+380
    19*cos( self.Time *150)*-1
    50*sin( game.Time *150)+100
    19*cos( game.Time *150)

    I noticed the top two were turned off so I assume they aren't used and could be deleted, so the only two actually performing any function is the bottom two.
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @bds62
    Any chance you could break the following down so I can understand exactly what's going on?
    Change Y position to . . . 50*sin( game.Time *150)+100

    This says position the actor vertically like this . . . .

    50 times the sine of the angle + 100 pixels,

    [50*sin] - Sine values move between -1 and 1, so not much use as we want bigger 'bumps' than that, so sine is being multiplied by 50.

    [game.Time *150] - The angle on which sine is operating is being generated by the game's time . . . (it's a quick and lazy way of generating an ever changing value) . . . the game's time is measured in seconds, so it would be a painfully slow way to generate a changing value (eg: it would take 20 seconds to move through 20° - or 6 minutes to complete a complete 360° rotation) . . . so we multiply this by *150 to speed it up.

    [+100] - adds 100 pixels to the equation, to shove the whole lot up by 100 pixels.


  • bds62bds62 Member Posts: 31
    Ok, that makes perfect sense. I really appreciate you taking the time to explain that.
Sign In or Register to comment.