View Single Post
Old 08 November 2018, 23:49   #315
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
In game coding, sometimes what appears to be the simplest of things can all of a sudden start to be a bit of a brain teaser, and by gum did this one make me think.

Consider when playing Rygar, have you noticed how the items that you can pick up always seem to land on a platform? Well that's no coincidence... it would be pointless if the items fell through the floor as you wouldn't be able to collect them.

This update shows that I've dealt with that. Basically I (fairly efficiently) check the tiles from the right part of the screen and look downward for a platform, if it runs into an obstacle or can't find a platform in that vertical line then it simply goes further along to the right and starts again at the top looking for a platform... when it finds the platform it push the item in there.

The video shows items being placed at particular frames.... notice how the items never fall off the edges.

[ Show youtube player ]

The code to remove them is also done, it's just not shown... I guess I'll save that for the collision stuff.

Geezer
mcgeezer is offline  
 
Page generated in 0.06473 seconds with 11 queries