I’ve been reading back over this series, and I have to say I’m pretty happy at how far we’ve come in such a short time. But I have to admit the one thing we need more of in this write-up is crappy MS-Paint level illustrations. So let’s fix that.
We start with our flying robot:
Pfft. I have no idea why people waste money on artists making concept sketches. I think this looks awesome already! In fact, we could throw a little lens flare on that thing and we’d be ready to start taking pre-orders.
As cool as this is, I think it would look even more amazing with a leg. Maybe even more than one leg. But we’ll start with one. The first step is to pick a horizontal offset from the body. Let’s say we draw a line that extends one unit to the left of the body. This creates a point which we will call the knee. The knee can move up and down, but it always has to stay the same distance from the body horizontally. (Yes, I could have the knee pivot instead of moving up and down, which would be more “correct”. But I’m going for an effect here.)
Now we make a line straight down to the floor. This line must always be a certain length, keeping the knee a certain distance from the floor. We will call this bottom point the foot.
As the robot moves, the knee will move horizontally to maintain its fixed distance. As it does so, it will run through a stupid-simple animation. The apparent location of the foot will actually orbit around the point that’s fixed to the floor. The knee will follow the same pattern, except that we cancel out the horizontal movement. This results in the knee just pumping up and down.
With one point moving in a circle and the other moving in a line, it produces motion a bit like the piston rod of an old locomotive.
Except, we don’t want the foot to go underground, so we flatten out the bottom of the circle.
Of course, having floating mathematical points is cool and all, but it doesn’t do us any good if the player can’t see this leg. So let’s construct a rectangle for the upper leg and have the lower leg consist of a single triangle.
Whoopsie, I bungled making the rectangle. I connect the points wrong, which results in two overlapping triangles like so:
But this actually looks a lot more interesting than just the rectangle leg. So, this has been promoted from bug to feature. Now we just slap a simple sprite over the knee to cover up the ugly point where the two polygons meet.
Now let’s give it another leg on the other side.
Now, I want the number of legs to be variable. And they all need to move through the same step animation, but at different points. Here is what I’ve figured out:
On one side of the body, the legs will be evenly spaced around the circle. So if there are two legs on the left side of the body, then when one leg is at 0° then the other will be at 180°. If there are three, then they’ll be at 0°, 120°, and 240°.
On the opposite side of the body, the legs will have the same spacing, but offset by a half-step. If the right legs are at 0° and 180°, then the other side will be at 90° and 270°.
How does it look?
You know, that’s kind of amusing. There are a LOT of parameters I could mess with: Move the knees up, move the legs out, make that step-circle animation wider or taller. I could adjust how much the head moves up and down. But this isn’t bad for a first try.
This Game is Too Videogame-y
What's wrong with a game being "too videogameish"?
Philosophy of Moderation
The comments on most sites are a sewer of hate, because we're moderating with the wrong goals in mind.
Grand Theft Railroad
Grand Theft Auto is a lousy, cheating jerk of a game.
C++ is a wonderful language for making horrible code.
Good to be the King?
Which would you rather be: A king in the middle ages, or a lower-income laborer in the 21st century?