Pixel Wars Part 4

•September 1, 2009 • Leave a Comment

Ok, the menus are done and they are working smoothly.

PixelWars2PixelWars3The buttons from left to right are dig, build barracks, build mining camp, and build base.Yeah, I know the build base icon looks bad, but I couldn’t think of anything better. If you think of anything post it in the comments. ^^ Next step will be to program a worker, and make him dig out tunnels. That meansĀ  I will have to implement pathfinding(ugh). Well, that’s all for now, hopefully I will implement pathfinding by the end of the day. ^^

Pixel Wars Part 3

•September 1, 2009 • Leave a Comment

Ok everyone, I got the basic menus sliding in and out. Just gotta draw the icons(ugh). Well, I’m going to go to sleep now, I’ll try to post some pics tomorrow. ^^

Pixel Wars Part 2

•September 1, 2009 • Leave a Comment

Hello again, here are some concept sketches for Pixel Wars:

Concept Art

Concept Art

As you can see, the graphics are very simple, but its easy to tell what they are. The buildings can be identified by the symbols on their sides, and the ground is shaded in. I believe that good graphics are not what makes a good game, it is the core gameplay. Good graphics can’t make up for bad gameplay, and flashy graphics take away from the game. So the graphics that you are seeing now will be close to the graphics of the actual finished game. That’s it for this post, in the next one I will hopefully have the menus working.

Pixel Wars Part 1

•September 1, 2009 • Leave a Comment

Ok, so i did a little work on my Pixel Wars game and got a little map prototype going:

Map

Map

So basically what this does is load the map from an array and draw it on the screen. This will make it easy for me to add/remove tiles. That’s it for this post, next time I will work on making the menu system. ^^

Pixel Wars

•September 1, 2009 • Leave a Comment

Hey everyone, just wanted to let you all know that I’ll be working on a new game. ^^ It will be a real time strategy game. You are trying to build an underground base, to defend against the incoming paratroopers, and will have a main base where you will be able to build workers. With your workers, you can dig tunnels in the ground and can start constructing a barracks and a mining camp. With a barracks you will be able to create attack units to attack the paratroopers. The attackers will automatically go to the surface to attack, or if there are paratroopers in your base they will go straight to them. All of your units can fly, so you don’t need to worry if there is land underneath them. The last building type will be the mining camp. With the mining camp you can build special units to collect gold to make you money. The miners will automatically dig out and bring gold to the camp for you. You can also build more main bases if you want to. Oh and you wont be able to control any of your units directly. You will be able to choose where to dig your tunnels and build your buildings, but no direct control. This is done to make it more like a strategy game and less like an arcade one. I will keep you posted as i work on the game. ^^

[Tutorial]Pong Part 4

•August 29, 2009 • Leave a Comment

Ok, in this tutorial we will be working on adding a paddle to hit the ball with. Download the project here. Before we start, go to your info.plist file and set the Initial interface orientation to Landscape.Now, to add the paddle, first we need to make a paddle struct. It should contain the position of the paddle, as well as the width and the height.

typedef struct {
Vector2D Pos, Old;
float radius;
} Paddle;

Now that we have our struct, we need to make our playerPaddle. Declare the playerPaddle in the game.h file with

Paddle playerPaddle;

Now we need to initialize the properties of our paddle. Lets set the width to 80 and the height to 20. Set the position to (-180,0). Now in the drawing section of game.m, lets draw the paddle. We can just call drawRect() do do that:

drawRect(playerPaddle.Pos.x, playerPaddle.Pos.y, 20, 80);

So if you build an run that, you should see the paddle being drawn on the screen.Now we want to be able to move our paddle, so in our Work() function, we can set the paddle’s y position to the position of your finger. Heres the code to do this:

playerPaddle.Pos.y = TouchPos.y;

If you build and run this, you will be able to move your paddle! Thats it for this tutorial, we’ll add collision detection for the paddle in the next post. ^^

[Tutorial]Pong Part 3

•August 29, 2009 • Leave a Comment

Ok so in the previous tutorial we made a simple ball move, but it just flew right off the screen. What we need to do is check if the ball is hitting the outside of the screen, and if it is, reverse its direction. Grab the files for this tutorial here.

Ok, so we can use a few if statements to check if the ball is outside the screen. First lets check if the ball is past the left side of the screen. To do that we need to know the radius of the ball. Lets add a radius float variable to our ball struct. After you have done that, set the ball’s radius to 16, in the initialization section. So now, we can check if the ball is past the left of the screen. Since the size of the iPhone screen is 480 * 320 we can easily check for this:

if(myBall.Pos.y - myBall.radius < -160)
{
myBall.Pos.y += 2;
}

So now if you compile and run this, you should see the ball bounce off the left wall. Yay! Now we just need to repeat this for all of the walls.

if(myBall.Pos.y - myBall.radius < -160)
{
myBall.Pos.y += 2;
}
if(myBall.Pos.y + myBall.radius > 160)
{
myBall.Pos.y -= 2;
}
if(myBall.Pos.x - myBall.radius < -240)
{
myBall.Pos.x += 2;
}
if(myBall.Pos.x + myBall.radius > 240)
{
myBall.Pos.x -= 2;
}

After you add this piece of code, you can see the little ball bounce around the screen! If you watch it long enough, you might even see it bounce directly into the corner! Well thats it for this tutorial, next time we'll add a paddle.

 
Follow

Get every new post delivered to your Inbox.