Welcome!

Hey, I'm Skylar, a kid aspiring to become a competent programmer. This blog is here to detail my dabbles in development.

My dream is to one day become a professional programmer and do some game development in my spare time.

Thanks for visiting my blog, and I hope you'll come back!

Pages

Back from vacation, here's the update!

Well after that long vacation, I should have something to show for it, and I do =0. I ended up actually finishing Pong, I accomplished everything I wanted in it, so I'm ready to move onto something else.

So at the bottom of this post, I'll have a link to the video of Pong, so if you want to watch it, go ahead.

Anyways, at the start of my vacation, the regular 2 player mode worked, except there was no system to keep score. I had a little bug on displaying the score, I was keeping track of the score in an integer called points, and I used a little C to display the integer as a string. so I was doing something like this:

void add_point()
{
++points;

char pointAmount[3];
sprintf(pointAmount, "%d", points);
surPoints = TTF_RenderText_Solid(font, pointAmount, textColor);
}

Since pointAmount is an array of characters, its passed as a char* into functions, which should satisfy the the function. Problem is it didn't. Later I found out, I had forgot to declare it as an array, so it couldn't convert from char to const char*. After that was fixed, the regular 2 Player Pong worked fine, the next step was to create so I could actually play alone =p.

Now I haven't the slightest clue what I did wrong in making the CPU. I made it and I looked over it quite a lot. And after it was done, it was the buggiest thing I had ever seen in my life. The thing looked like it was on speed, bouncing around like no tomorrow. The more I tried to pin down what was wrong, the worse it got. I decided it was too horrible to even use, so I took it out and decided to start from scratch.

Before I re-started the CPU, I implemented a pause feature. It sucked, but it worked for the time being. I just used an SDL_Delay after rendering if a pause flag was true.

When I remade the CPU system, it worked completely how I had planned, so that portion was done with.

I then upgraded the pause feature to what it is now, I had no problems with this, it was actually really simple.

After that, I just wanted to add in sounds, change the graphics a bit, and add in a challenge mode. So the first thing I did was add in sounds, all the music I used was created by Rachel J. Morris (LussikkaMage) and were taken from her public domain sounds over at Moosader.com. The sound effects were just some other public domain sounds that I got from a random site that isn't really important.

I made the graphics myself (hence why they suck), but it is a little more interesting than the black and white it was before.

The challenge mode became a problem when I failed at making a timer. I screwed up the timer's pause and resume methods, so the score would go out of wack when the game was paused. I found the problem, I forgot subtract the current time, from the start time when I assigned the value to the ticks when paused.


After all that was done, I took a 3 day break and got some nice relaxation. I also made a little bouncing ball demo while I was up there, because I was bored, and wanted to play around with some gravity effects.


Well that's the end of Pong development, soon I'll start my next project and will document everything about it.

Pong Video

0 Response to "Back from vacation, here's the update!"

Post a Comment