Not sure this is the best way to do this, but it works. Working on a project and I’m writing a lot of code to…
Not sure this is the best way to do this, but it works. Working on a project and I’m writing a lot of code to…
For another site of mine I needed a way to determine whether black or white was a better choice for text on a randomly colored…
Getting enemies to move tends to be one of the more difficult things for me to get right. It just doesn’t always seem natural. And I’m not talking about moving with any type of AI. Just moving around the screen in a pattern.
Sure, straight lines are pretty easy. But games get really boring if all the enemies just go from right to left or left to right.
For this post we’re going to explore moving an enemy through a series of waypoints using ActionScript 3. I’m going to create a movie clip symbol in Flash named Enemy_mc.
Doesn’t do much good to explain with words. This is what we’re going to create.
One minor difference. I set this demo up to loop so the enemy goes back to its starting position and sets its current waypoint back to 0 when it gets to the last one. The real deal will remove the enemy from the stage.
It’s a pretty common task to get the distance between 2 points. Maybe you’re wanting to see if two points are close enough to have…
There are two ways to measure angles. You probably learned to measure angles in degrees early in school. A circle has 360 degrees, a perfect…
At first glance the Pythagorean Theorem doesn’t appear to relate to game development. But we’ll see in a bit that it does. First though, let’s…
Creating the next great side scroller? Well, you’ll need a scrolling background. And if you’re programming in Java, here’s an easy way to do it.
Here’s a little demo of what we’re going to create. What’s happening is that there are two copies of the same image scrolling from the right to left. As one copy gets all the way off the left edge it leapfrogs back over to the right side. Normally they’d be the same, but it makes more sense on the demo for the two copies to be different colors.
The black box is the screen. Everything to the right or left of the box is happening off screen.
Click to start and click to stop.
This is a follow up to an earlier post where we created a scrolling background in Flash using ActionScript. This time we’re going to do the same thing, but using Python and Pygame.
Take a look at your favorite game. Odds are good that there is a scrolling background of some type. Think Super Mario Brothers.
Mario is a bit different than what we’re after though. The background in Mario is a single graphic that scrolls as Mario moves through the world. What we want is a scrolling background that loops forever. We’re going to scroll horizontally like a platform jumping game, but the same concept works vertically.
Thanks to Pygame, there’s a quick and easy method to get the dimensions of an image. You just have to load it into a Surface…