TreeWars

Project Treewars: Going in Circles

It’s been quite a while since I actually worked on TreeWars. Various things have distracted me, including some other programming projects. But I actually made some progress way back in July, before I shelved the project temporarily. So, let’s talk about circles.OpenGL gives us a few different ways to draw things, which I’ve talked about before. When we were using the fixed-pipeline functions (glBegin(), glEnd(), etc), I could draw a circle the same way I drew it in SDL: draw a bunch of same-sized rectangles, shifting the coordinates around a central point so that they overlap.
Read more

Project TreeWars: How Anna got her Title Screen back

In my last post, I re-implemented all of my rendering code to take advantage of Shaders. After doing this, nothing rendered. Despite the fact that I was following a tutorial, more or less. I have been modifying it to fit my project, which has a lot of code around the rendering code already and is in C++ instead of C, and also modifying it to do something that will actually be useful for me down the line.
Read more

Project TreeWars: When is an OpenGL not an OpenGL?

So, I was playing around with the ‘sparks’ feature on Google+. Since I’ve been working with OpenGL lately, I made a spark for it. On that spark, I came across this thread, which gave me this advice:A general rule of thumb is that if a tutorial contains calls to glBegin, glEnd and/or any of the glTexEnv functions then it’s old and you should avoid it.Now, I wouldn’t generally trust a single person on the Internet with nothing to recommend them, but I’m seeing this advice repeated in several places now that I know to look.
Read more

Project TreeWars: the road to OpenGL

Over on Shamus Young’s blog, he recently said this when talking about a programming project of his:One of the things I like about this project is that it is uncluttered by goofy, awkwardly-designed libraries.Shamus is working on a procedurally-generated 3D world using OpenGL. Now, I know what he means. He is trying to avoid relying on things like graphics and physics engines, or 3D model importers, or any of a number of other tools that often have asinine and byzantine APIs.
Read more

Project TreeWars: How to write bad code

The TreeWars project is a week and a half old (at the time of this writing). It’s come a long way; in its current form, it actually looks pretty neat:There are now stats, and hit points, and the basic gameplay mechanic is in place. I’ve also laid the groundwork for some more complex gameplay, as well. Of course, I haven’t talked about gameplay all that much yet - we’ll get to that at some point, I’m sure.
Read more

Project TreeWars: The Beginning

My goal is two posts a week - typically, one on Wednesday and one on the weekend. This is usually a pretty easy goal to obtain - it doesn’t take too much of my free time to churn out two posts between 750 and 1500 words. And yet, there almost wasn’t a post this weekend. Was I playing Minecraft? Nope.I was writing code.Programming is something I’ve always wanted to do professionally, but somehow I managed to end up doing enterprise technical support instead.
Read more