# My first game. Take a look at it, plz! :)

## Recommended Posts

Hi guys! I'm making my first pong. I made a tetris before but it had one million bugs so it doesn't count hehe. My pong is very simple, it has no limit of points and it has a lot of bugs.. so I'd wish you to take a look at it and tell me what can I change or add to it. Here's the link BTW.. the ball do the same thing always.. it's like it has a pattern and it follows it everytime. It's difficult to me to explain it (I don't know english very well) so.. take a look at it and you'll know what I'm trying to say. I hope you like it! Thanks in advance. (How do I post a link with labels? like [src][/src]?) - Solved :D [Edited by - comfortablynumb84 on May 3, 2007 9:13:51 AM]

##### Share on other sites

Just use HTML tags to get that. I'll take a look at it later. Have to go to school soon.

##### Share on other sites
Wh1sp3r    122
Nice Game ! Keep up your good work.

To solve your ball pattern problem, I think you should tilt the ball direction depending on where it hits the paddle : if it's not in the middle, change the angle a little.

##### Share on other sites
Good work! Next step is to build on what you have. Improve it!

##### Share on other sites
Quote:
 Just use HTML tags to get that. I'll take a look at it later. Have to go to school soon.

Thanks for the tip :D

Quote:
 Nice Game ! Keep up your good work.To solve your ball pattern problem, I think you should tilt the ball direction depending on where it hits the paddle : if it's not in the middle, change the angle a little

Thank you! Yes, I was thinking about it.. I'll try to do it today.

Quote:
 Good work! Next step is to build on what you have. Improve it!

Thanks for your comment! Yes, I'm thinking on put some power ups, a top score table and some music too. I want to add some more features to this game before start a new one like tetris.

Again, thank you all for the replies!

##### Share on other sites
programering    105
I'm going to try out your game now.

<a href="target">link caption</a>

##### Share on other sites
programering    105

##### Share on other sites
Try again in a few minutes! They could download it a few moments ago. Thanks por the tip of html tags =)

##### Share on other sites
programering    105

##### Share on other sites
programering    105
But now I found out that you had to enter that number, I wasn't so observant.

##### Share on other sites
programering    105
I've tried your game now. the graphics is good, but you could use a delay and a notification for every new round and some sounds(for when the ball is hitting the paddles).

##### Share on other sites
Hehe thanks!! yes, a friend of mine told me that too. I have to add a lot of things. I'm fixing now the pattern of the ball. It's almost complete. When I finish I'll upload a new version. Every comment you say helps me a lot guys. Keep posting! thank you very much. :D

##### Share on other sites
oliverb    122
I'm new to this too, so by no means an expert (and I'm really envious of your score board xD) but your game seems to have a memory leak (it just gets more and more when you let it run, while simply having the game open just now it climbed from 4mb to 20mb) and it does not shut down properly for me (it closes, but in the task manager I still find a "SDL2.exe" with around 85% CPU usage).

##### Share on other sites
Oooops, I didn't notice that. I thought Cpu usage was fixed since I put SDL_Delay( 1 ). I'll take a look about that. And I just checked my code and I don't see any memory leak. I freed every surface I used and I deleted every pointer. So.. How can it being using so much memory? any ideas about that?

Thanks a lot!

##### Share on other sites
hello. i have a memory leak on my pc too. try to look at font rendering. i dont know but if you have a function to render text like
DrawText(SDL_Surface *textSurface), then also free this surface like
{
TTF_RenderTextBlabla(textSurface);
SDL_FreeSurface(textSurface);
}
maybe that helps :)

##### Share on other sites
I checked every surface and everyone has it's SDL_FreeSurface(). I render with TTF_RenderTextSolid(). I pass a stringstream to it. The font must to be closed at the end of the program, right? I don't know what's going on. I included the source code in the file. Can anyone take a look at it and tell me what's wrong? it's poorly coded, I know.. don't laugh of it :D lol.

##### Share on other sites
Hehe you were right! I found the bug. I didn't free some surface. I didn't see them. Thanks a lot! now a little question.. is SDL_net too difficult to use? because I want a network feature in my game.

##### Share on other sites
oliverb    122
Quote:
 Original post by comfortablynumb84I checked every surface and everyone has it's SDL_FreeSurface(). I render with TTF_RenderTextSolid(). I pass a stringstream to it. The font must to be closed at the end of the program, right? I don't know what's going on. I included the source code in the file. Can anyone take a look at it and tell me what's wrong? it's poorly coded, I know.. don't laugh of it :D lol.Thanks in advance guys!

I actually thought of doing that, but the mix of English and Spanish (? at least I think I remember "derecha" from the few Spanish classes I had ;)) put me off somehow ;)

Anyhow, do you perhaps have a link to the sources/documentation you use for text rendering? I've looked a bit today, but haven't found anything too appealing...

##### Share on other sites
Quote:
 I actually thought of doing that, but the mix of English and Spanish (? at least I think I remember "derecha" from the few Spanish classes I had ;)) put me off somehow ;)Anyhow, do you perhaps have a link to the sources/documentation you use for text rendering? I've looked a bit today, but haven't found anything too appealing...

Hehe sorry, I forgot that I use both languages to make my source. I choose some words in English that are shorter than in Spanish, and I mix them. It's easier in that way for me :D I read about text rendering from Lazyfoo's tutorial ( they're nice ). I've found the bug, I didn't free some text surfaces. I put the link for a patch that fixes some bugs here.