A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: 2d Side Scroller

  1. #1
    Moderator CNO's Avatar
    Join Date
    Jun 2000
    Location
    Brooklyn, NY
    Posts
    3,446
    Hi all,

    I have been interested for some time in making a 2D side-scrolling platform game in Flash, and wondered if I could get some feedback on what might be the best way to handle the environment while keeping down the file size. I've been searching the boards, and doubt that a maze-style or grid method would work if I were to allow the game to scroll left to right. I'd like to avoid needing each area have collision detection, but may have to resort to this given the limitations of the program. I'm also considering having the stage broken down into sections, this way I need only scroll a portion of the screen, then the next section of the stage would be a new scene. This way, perhaps I can be crafty with preloading.

    If you have any ideas, please e-mail me or (preferably) post them for the benefit of all to see. Lots of great and creative minds here, sure something should come up. And thanks in advance for your time,

    --Chris

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881

    Sure We Can Help!!!

    check out this site: http://www.ruling.com.sg/flash/index.htm

    If this is what you mean then yes i can help you!!!


    Regards Flashguru

  3. #3
    Moderator CNO's Avatar
    Join Date
    Jun 2000
    Location
    Brooklyn, NY
    Posts
    3,446
    Sorry, re-reading my post I probably could have been clearer.

    The game you sent along is excellent (Inspiring), but I was considering something more akin to a Super Mario Bros. or Mega Man style platform game, where the stages scroll. (For now I would probably be limiting it only to left/right scrolling - anything above or below [ie. climbing a ladder] would result in a new area being loaded). The difficulty comes in how to handle things like making platforms solid (so they can be hit from below, or jumped on from above).

    I'm considering experimenting with some some one-sided collision, perhaps, where the player can jump through a platform from below, but then will not fall through again.

    And I have no doubt that you guys can help, otherwise I wouldn't have asked here.

    Thanks again,
    --Chris

  4. #4
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Now there are couple of ways of doing this. I would suggest if you read couple of msg. bellow about the mazes we were talking about this. One thing which I can tell you right away is dont waste time with the collision detection. It will work with no doubt but the scripting will be heavy and if you re planning putting bad guys will be a problem to handle all of them. Im making a new demo I hope will be out soon. Im not telling you how it goes cos its full with bugs and I still dont know if its going to work at all. Ill keep in touch and let you know wich is the best way to my oppinion.
    Mad_sci

  5. #5
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    The best way to do it would be:

    Get the x position of an object that you want to do collision detection for then using this x co-ordinate caluclate the left and right sides x position and from this you can check for collisions if you are using a left and right scroller!!!

    The scroller is fairly simple to do!!!!i Have an example if you want it!!!

    heres the code for the collision:

    set variable: "objectx" = Getproperty("/object",_x)
    set variable: "objectwidth" = Getproperty("/object",_width)
    set variable: "objectleftx" = objectx - objectwidth
    set variable: "objectrightx" = objectx + object width


    Then you should get the rightside of the charcters x psoiton and check to see if this value is greater than the leftx of the object and less than the rightx of the object!!!

    You will have to do this inside a moviclip with two frames so that this detection continuously loops!!

    If you want a better explanation and/or soem examples and stuff!!

    Then Just Icq Me On: 71063418 or E-Mail me!! I would love to help!!!

    Regards Flashguru

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center