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

Started by
17 comments, last by comfortablynumb84 16 years, 11 months ago
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).
Advertisement
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
--------------------------------Welcome to Silent Hill
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).
-----<me>
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!
--------------------------------Welcome to Silent Hill
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 :)
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.

Thanks in advance guys!
--------------------------------Welcome to Silent Hill
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.
--------------------------------Welcome to Silent Hill
Quote:Original post by comfortablynumb84
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.

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...
-----<me>
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.
--------------------------------Welcome to Silent Hill

This topic is closed to new replies.

Advertisement