Sliding Tile Collision Demo And Source Code

Sdílet
Vložit
  • čas přidán 11. 03. 2024
  • Sliding Tile Collision Demo And Source Code
    Written using the Blitzmax language.
    Windows demo and source code available from my Dropbox at.
    Sliding_Tile_Collision.zip
    www.dropbox.com/scl/fo/8r5k4t...
    This demo shows an updated version of my Sliding Tile Collision Code.
    The actual code is quite small and should be quite easy to plug into anyones project should they need it.
    Tile collisions form the basis for a lot of games, usually 2d platformers, where the tiles define the collision geometry for the game, which do not get drawn and the actual game graphics are drawn on top of the collision geometry.
    This is the method i used in my 'Mayhem's Adventure In Monsterland' Demo for example.
    The player movement in the demo uses fixed point math to add velocity to the players position at integer values.
    This ensures perfect collisions.
    Smoother movement for the player can be achieved using Floats but this introduces a visual error of 1 pixel when resolving collisions.
    Space = Reset Tiles
    Cursor Keys = Move Player
    (F1 , F2) (F3 , F4) = Alter The Tile Size ( The Tiles Can Be Rectangles As Well As Squares )
    Escape To Exit
    Run Demo.exe for the demo
    Run Setup.exe to set the options, screen resolution ect
  • Hry

Komentáře •