Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42

Thread: Making a platform game - few questions

  1. #1

    Making a platform game - few questions

    I'm using SDL, and it's a 2D platform game.

    1. Screen scrolling? Is it like this - you draw a level with a resolution of, let's say, 10000 x 2000 and then while moving the player, you move a rectangle on the background surface and blit it on the screen?

    2. Okay, so background is not a problem (presuming that I got this scrolling thing right), so I wanna know about drawing the platforms. Do I draw them all at once with a black (or white, or whatever) background, which I eliminate with colorkey?

    3. When jumping, how do I detect if there's floor underneath the player? You don't have to write a code, I'm just stuck at the logistics part.

    4. Player sprites. I draw a couple of player sprites in different positions, then I load the first one into a player var and blit it on the screen. When I need a different sprite, I just load a different rectangular position off the BMP file (the one that contains the sprite I need) into the var and blit it on the screen, right?

    Hmmm, what else?
    I think it's all for now.

  2. #2

    Making a platform game - few questions

    Hi Ixy, perhaps the below site will help you

    http://www.tonypa.pri.ee/tbw/start.html

    It is a site about tile based games written using Macromedia Flash, but I used the info for a Delphi/freepascal 2d tile platform game I started writing just fine

    cheers,
    Paul

  3. #3

    Making a platform game - few questions

    Tilemap is the easiest way to go. You can make a tile specific collision or physics behaviour. This map should cover most if not all sprites and problem about calculating how to hit floor. This is how most of Mario games are done.

    Dynamic spritemap is much more complicated thing to code even though it would allow tile/sprite placing anywhere. Most modern rpg/mmorpg games use something like this.

  4. #4

    Making a platform game - few questions

    Thanks.
    @ paul: can that tutorial be applied to all tile based platform games? Because, I see they're talking about isometric 2D games, mine is Mario-like, from the side.

    Tiles? Got it.
    I'll examine this tutorial really good, then get to work.

  5. #5
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Making a platform game - few questions

    as you described that is what we did in Uber Zombie. We have a level, thats a big texture of the whole level. For collision detection we have a 'collision texture (c) tm)' that defines in color codes what's what. For example red is ground, green is ceiling and yellow is a wall. However this can be enything you like and works well for small levels.

    If you want a big level i guess you can do the same with tiles.

    (My website is currently down so I cannot show off any examples, but here are some screenshots: http://www.greatgamesexperiment.com/game/UberZombie )
    NecroSOFT - End of line -

  6. #6

    Making a platform game - few questions

    This might help you out a bit: http://eonclash.com/ViewProduct.php?ProductID=29

    Its a very simple side scroller implemented with SDL using FPC. It loads the "map.txt" file and displays it on the screen. You can scroll left and right across the map easily enough.

    To add a background you would need to modify game.pas and in GameFrame add the background draw before the map.Display function is called. Of course you would also have to add the player sprite and etc...

    Hope it helps.

  7. #7

    Making a platform game - few questions

    New problem (haven't solved the old ones, but i'll take care of this first).

    I've implemented "gravity" for my jumps using something similar to this.

    The thing is now that my jumps are too fast in comparison to regular movement.
    But they're not so fast as the regular movement is slow.

    So my question is - how to speed up movement? I haven't used delay at all...

  8. #8

    Making a platform game - few questions

    Quote Originally Posted by Ixy
    New problem (haven't solved the old ones, but i'll take care of this first).

    I've implemented "gravity" for my jumps using something similar to this.

    The thing is now that my jumps are too fast in comparison to regular movement.
    But they're not so fast as the regular movement is slow.

    So my question is - how to speed up movement? I haven't used delay at all...
    it's hard to tell anything if we don't see any code :?
    From brazil (:

    Pascal pownz!

  9. #9

    Making a platform game - few questions

    Are you using vectors or angles? Jumping and gravity only affects the Y component of player movement and acceleration vectors.

  10. #10

    Making a platform game - few questions

    How about an updated Demo with Physics using APE. Download from http://eonclash.com/ViewProduct.php?ProductID=29

    Character can move around within the world and jump between platforms. I have to admit, using a real physics engine like APE is major overkill, but in the end its a nice effect.

    PS: You really do need to post up some code and/or screenies for anyone to be much help.

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

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