angles in 2d tile based engine

Started by
5 comments, last by sakky 19 years, 3 months ago
Okay, the tile engine I have works great for non inclines, its time to start to think bout that, i know its a bugger to figure out but I need to start and would love resources on it. I have some of my own ideas on how to do it but i know there is a ton of stuff out there on how to do it better I am sure. But the problem is, I must suck at googling, cause I get no relevant information with the searches I use. And the forum search here seems to be down. So anyone have some good resources on how to make it where a 2d tile based engine can handle tiles that pitch up for upward and downward hills? thanks guys.
Advertisement
Hmmm, maybe you should look into isometric tiles. Try looking here. Or you could talk to TANSTAAFL. That guy knows tons of stuff about tile based things. Here are a few of his tutorials:

Tutorial 1
Tutorial 2

I’m not to sure what you’re looking for though. But maybe you can give a few more details on about what your looking for and maybe I can give some better advice or references.
Take back the internet with the most awsome browser around, FireFox
Well my current tile engine handles tiles like that in original mario, where to get to a higher platform u usse steps.

Now if you look at say many 16bit games, they have hills instead of steps up to higher areas, like sonic. you can run up a hill. I am not sure how to handle the collision and deal with tiles that make the character go at an incilne. The way i was thinking:

I have these canmove functions that test the attribute map for a collision with say a brick tile. What if there were special tiles that when drawn were an incline (like half the tile since all things are square is inclined, and the rest is drawn with my color key: magenta) that way when its drawn u dont see the pink part of the square tile just the tile part, which looks like 45 degree incline or something), then i make the attribute of such tiles a special case where it sees what direction your running and when the player collides with that tile it responds by just not rejecting the sprite from the tile but rejecting it and moving it up at an angle. If that made sense?

oh well any references on how to deal with hills like in a 2d platformer would be great.

Maybe a system to where each tile had a clipping powers and directions might work. Something similar to what you are speaking of. You could use a integer that holds the direction of the incline and use it. Say if sonic moves and to comes across a tile with too steep of an incline value then he is clipped.

That is a good question. I guess you would just have to play around with many different algorithms until you cam up with one that worked good. Try looking on Google. Maybe you try some sort of vector logic that applies force against you sprite. If the vector was to great then of course the sprite would not be able to pass.
Take back the internet with the most awsome browser around, FireFox
Oh man I’m too nice. I found this link. Down at the bottom of the page you will see a section titled Slopes. That should answer some of you questions.
Take back the internet with the most awsome browser around, FireFox
awesome, arg slopes couldn't think of the word :) hee hee thanks man.
You welcome! I'm always willing to help out as much as I can. Drop me a line if you need anything else.
Take back the internet with the most awsome browser around, FireFox

This topic is closed to new replies.

Advertisement