In the past I have made some abstract games, some text based games and a few platform games. Text based is obvious and irrelevant here. Abstract games generally involve drawing and moving sprites around (e.g. draw 'knight' sprite at co-ordinates [4, 3]). Platform games are similar, except there is some sort of 'physics' going on. I loop over my character and enemies, maybe each frame, and check if there is a 'block' under them, if there is that's fine. if there isn't they may have an 'isFalling' attribute which gets set and while it is set - 'gravity' decreases their 'Y' coordinate, until there is something under them. The world/level is stored as a list of objects (floors/spikes/water) with their x, y co-ordinates so I can loop through to see what the character is 'standing' on (or not).
So a slightly nicer looking game may have slopes. So, how do I check whether my character is standing on anything? I can represent a line (say a sloped floor) as two sets of co-ordinates. My line may be [(0,0),(100,20)] and I can store the whole level with as many lines as need be as a big list and loop through them, but if my character is at (15,3) - how do I know that he is standing on that bit of floor.
I suppose I have an idea that pops into my head, but I don't know if it's plausible or sensible or if there is a better way.
When the level starts, I can convert all the vectors for the level into 'traditional' blocks and store those as a list just while we are on this level and then do the same for the next level when we get there. So a line [0,0]-[15,15] might make the following 5 pixel sized blocks: (0,0) (0,5) (0,10) (5,5) (5,10) (10,10) Each block would need to store the 'angle', so I would know whether, which direction and how fast my character would slide down a hill if it was steep.
And what about if I further complicate matters and want curves?