Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial X: the roads between the cities #1

Open
EtienneBruines opened this issue Apr 11, 2016 · 7 comments
Open

Tutorial X: the roads between the cities #1

EtienneBruines opened this issue Apr 11, 2016 · 7 comments

Comments

@EtienneBruines
Copy link
Member

So, at some point, it'd be nice to connect cities by means of roads.

The back-end knowledge is easy. Allow passengers to use those roads, also not much of a problem.

But I am wondering how to render the roads. I mean, we might have a road-texture (.png or something) which is 10 units long. If we wanted to create a road that's 100 units long, we somehow set OpenGL to repeat the texture (not sure how again? But I'm sure I can look that up). Or should we physically have 10 of those "10 units long" road-pieces (also in the game-logic), and let them be "connected"?

We would need rotation support, which will be added soon (I hope), if we want to add diagonal roads.

Thoughts? Any possible solutions? Any possible difficulties anyone foresees? @paked do you have anything to add on this?

@paked
Copy link
Member

paked commented Apr 11, 2016

The way most games would tackle this problem is with tilemaps. So you have a lot of small images, that get placed on a grid in a specific order make up the map.

This kind of thing:
http://www.ludumdare.com/compo/wp-content/uploads/2008/12/road_tiles.jpg

Unfortunately, our tilemap system is broken/non existent anymore. So we're going to need to fix that. EngoEngine/engo#162.

@EtienneBruines
Copy link
Member Author

Yeah, I was looking for a way without tilemaps; but I think that's probably the hardest way to do things (and why they have only been doing it the "new" way for a few years).

@paked
Copy link
Member

paked commented Apr 11, 2016

@EtienneBruines What do you mean by the "new" way?

@EtienneBruines
Copy link
Member Author

I mean being able to draw a straight road between points (10, 10) and (123, 432), render it and then use it in game logic.

@gerbenjacobs
Copy link

How about a regular drawn line, which will be a simple coord A to coord B and will introduce simple shapes (if those are in the engine)

@paked
Copy link
Member

paked commented Apr 26, 2016

@gerbenjacobs Not quite yet, EngoEngine/engo#131. But that is a good idea!

@EtienneBruines
Copy link
Member Author

Fixed in the playground branch.

@gerbenjacobs I've indeed implemented them as such (since EngoEngine/engo#131 was merged a few days ago). 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants