Results 1 to 3 of 3

Thread: Walking in 2D game

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question Walking in 2D game

    Hi,

    I want to see if my theory is a good one or if there is an easier way to do this. I want to create a 2D scrolling game similar to mario style where you walk, jump, etc. And I want the land that you walk on to change height such as slopes, etc. And also have multi-platforms on one screen where you can jump up on the other and walk.

    Here is how I was thinking of doing it.

    First I was going to drawn a very wide background full of graphics for the level. Then I was going to create an array for each platform having the X/Y coordinates. Each platform is a different array. For example, if there is one platform to walk on all the way along the bottom, thats one array. then any others above are seperate ones.

    When I move my character, it just checks the coordinates of when moving forward and change the height of the character according to the coordinates. This keeps the character level with however the platform changes if it slopes, etc.

    Is this a good way of moving the character when walking around?

    Thanks!

  2. #2
    New Member
    Join Date
    Aug 2008
    Posts
    1

    Re: Walking in 2D game

    hope u got it

  3. #3
    Lively Member
    Join Date
    Aug 2008
    Location
    Palm Desert, CA
    Posts
    91

    Re: Walking in 2D game

    Hi, Warren W.

    The solution you came up with makes good sense and if you put it together right it should not be a problem. There is one catch though. Writing a simple routine that allows a character to move to the left and right will cover the majority of most side scroller levels. That includes jumping up to a platform and etc. That way there is less calculation during the scrolling. Then you could do exactly what you said and apply it to just the segments that slope. Collision detection will be a little easier to implement this way.

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