Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Mapping out a bend in the road - help plz!!

Author
Message
stuartm
21
Years of Service
User Offline
Joined: 17th Jan 2003
Location:
Posted: 17th Jan 2003 16:48
Say i was writing a 2d top-down driving game with just straight 90-degree roads I could use a simple datafile like:
----------------------------------------
1='drivable' road, 0=non-drivable road

0000100
0000100
1111111
0000000
----------------------------------------
but what if i wanted a bend (or non 90-degree curve) in the road, can anyone give me any clues how to implement this into the mapping system ??

thanks,
SM
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 20th Jan 2003 03:44
sure... make the road at intervals of what you want it bent to
then simple to a point-to-point curve value to work out the placement across a grid
as some will want to cross over 2 squares you'll need to take this into consideration

Anata aru kowagaru no watashi!
stuartm
21
Years of Service
User Offline
Joined: 17th Jan 2003
Location:
Posted: 20th Jan 2003 11:46
thanks for the reply, could you give me any more detail on this bit plz, not sure I understand:
"then simple to a point-to-point curve value to work out the placement across a grid "

Do you have any example code of a 'point-to-point curve value'? thanks for the help!

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 20th Jan 2003 11:53
2 = a corner

3 = a t intersection

4 = a cross roads

u may need 4 corner numbers if u dont have a method for rotation of one symbol

stuartm
21
Years of Service
User Offline
Joined: 17th Jan 2003
Location:
Posted: 21st Jan 2003 13:44
thanks for the reply Indi, think I should have wrote the question a bit clearer though.

Say 2 is a corner tile, and is also 'drivable', then the car sprite is going to be able to drive over the whole tile, not just the 'road' part of the corner, that make sense?

I guess what I'm looking for is to make only a certain (curved) amount of the tile 'drivable', I think this would be much easier to explain with some gfx :o)

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 21st Jan 2003 14:35
currently if u want to use tiles in a matrix to acheive this effect u will need a tile rotated for each instance required.

I posted a free 2d graphics template at RGT that solves a lot of gradient issues between colours or textures on your matrix if u are going to achieve it with a matrix for the ground.

Patch 5 - 6 is when Lee will look at rotating individual tiles so we dont need 12 per 2 but only 3 per 1

this idea is assumed its a matrix that underlies your ground of course.

stuartm
21
Years of Service
User Offline
Joined: 17th Jan 2003
Location:
Posted: 22nd Jan 2003 11:14
thanks Indi.
Has anyone got any tips on getting the collision detection working for a car sprite on a 'corner' tile of a 2D map? thats what i'm looking for really :o)

Login to post a reply

Server time is: 2024-03-29 07:46:25
Your offset time is: 2024-03-29 07:46:25