First development update

Published March 24, 2005
Advertisement
This would be a good point to state that I don't believe in big up-front design. No matter how much time you spend planning, you always end up redesigning and changing things anyway. Therefore I only do a little design on paper before hacking together a prototype. I think of it in similar terms to the optimisation debate, in that you can spend so long worrying about getting it right first time that you're spending too much time on micromanagement that would be better spent by diving in and seeing if the naive solution is actually more than adequate.

Therefore I follow this procedure:
1) Pick a feature or use case to implement.
2) Make it work.
3) Clean up the code.
4) Tweak for efficiency if necessary.
5) Rinse and repeat.

Today's 'feature' was a tiled map in OpenGL, just to get the ball rolling. After a few hours of playing around, I had it up and running. This basically just loads in some OpenGL textures, calls glOrtho, then draws some random tiles on the screen while you click to re-centre the map.

I had a preliminary version running in about 20 minutes but that drew tiles to the screen by calculating screen positions from the world and camera positions manually. I wanted to change this so that I just sent tile locations to OpenGL and it translated them for me, and that was harder than it looked; not in terms of complexity, but in terms of the number of different ways I could approach it, almost all of which were wrong. :)

Code line of the day:
glTranslatef(static_cast(-cameraX), static_cast(-cameraY), 0.0f);

And they say Java is verbose.
Previous Entry A new project
Next Entry Day 2
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement