Sign in to follow this  

angles in 2d tile based engine

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this