[HN Gopher] Guide to implementing 2D platformers (2012)
       ___________________________________________________________________
        
       Guide to implementing 2D platformers (2012)
        
       Author : vvoruganti
       Score  : 93 points
       Date   : 2024-09-27 16:39 UTC (6 hours ago)
        
 (HTM) web link (higherorderfun.com)
 (TXT) w3m dump (higherorderfun.com)
        
       | jonathanyc wrote:
       | I like the idea of a guide like this. Reminds me of
       | "Implementation of Hex Grids," another high quality game-related
       | guide:
       | https://www.redblobgames.com/grids/hexagons/implementation.h...
       | and before that, "Beej's Guide to Network Programming":
       | https://beej.us/guide/bgnet/
        
       | matheusmoreira wrote:
       | > I believe that Mega Man actually employs infinite acceleration,
       | that is, you're either stopped or on full speed
       | 
       | Yeah, acceleration is essentially infinite.
       | 
       | https://tasvideos.org/GameResources/NES/Rockman/Data
       | 
       | When moving horizontally there's very small lag at the start and
       | then he accelerates to full speed pretty much instantly.
       | 
       | When moving vertically by jumping, his speed is straight up set
       | to some constant. There is downwards deceleration by gravity
       | though, leading to "fall faster" tricks:
       | 
       | https://tasvideos.org/GameResources/NES/Rockman#FallingFaste...
        
       | henning wrote:
       | For making the game more fun, you can then add features that are
       | now standard/expected like coyote time.
       | https://www.youtube.com/watch?v=97_jvSPoRDo
        
       | dang wrote:
       | Related. Others?
       | 
       |  _Guide to implementing 2D platformers (2012)_ -
       | https://news.ycombinator.com/item?id=31450218 - May 2022 (37
       | comments)
       | 
       |  _A guide to implementing 2D platformers_ -
       | https://news.ycombinator.com/item?id=10202275 - Sept 2015 (32
       | comments)
       | 
       |  _The guide to implementing 2D platformers_ -
       | https://news.ycombinator.com/item?id=4065033 - June 2012 (2
       | comments)
       | 
       |  _The Guide to Implementing 2D Platformers_ -
       | https://news.ycombinator.com/item?id=4005883 - May 2012 (2
       | comments)
        
       | moth-fuzz wrote:
       | I've implemented platformer collision dozens of times now and the
       | only way I've found it to be genuinely smooth is to do it one
       | pixel at a time, just like the author suggests.
       | 
       | But something always bugs me about that - we know the closest
       | edge of the closest obstacle, we know the vector of the player's
       | motion, by all accounts we _should_ be able to calculate the
       | point of contact in one go without doing any substeps.
       | 
       | And yet, doing it in one pass always seems to result in a myriad
       | of edge cases (literal!) that break the whole thing, unless you
       | do heavy preprocessing, converting your tiles to a graph of lined
       | surfaces, etc etc.
        
       | teddyh wrote:
       | > _Type #1: Tile-based (pure)_
       | 
       | > _Character movement is limited to tiles, so you can never stand
       | halfway between two tiles._
       | 
       | [...]
       | 
       | > _Examples: Prince of Persia_
       | 
       | That is absolutely false. You can stand on any pixel in Prince of
       | Persia. It's when I find stupid errors like these that I start to
       | question the entire article they appear in.
        
         | nurettin wrote:
         | As I remember, when you step slowly from the middle of a tile,
         | you always end up on the edge of that tile. And if there is a
         | chasm and you try to step once again, you almost trip and
         | regain balance. If there is no chasm, you step to the middle of
         | the next tile.
        
       ___________________________________________________________________
       (page generated 2024-09-27 23:01 UTC)