Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

graveyard filla

my first 2d game, please critisize my code/game

This topic is 5323 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

high, my first 2d game (pong clone with a twist ) is finnally complete. i made it in c++ using SDL. i would REALLY appreciate any feedback (be nice) on the code(ESPECIALLY if you know anything about SDL), i made this from scratch with only help from you guys on this board. if anyone could take a look at the code, and give me (constructive) critisism, i would appreciate it. you can download the .exe and the source here or if thats down click here thanks for all your guys help!! if it wasnt for you guys it would have been much harder to do all this. ps, if you do read the code, try to forgive me when you get to the Draw_Score() function. i know its really sloppy, i hacked it togeather and got to lazy to fix it. works great tho . thanks guys. [edited by - graveyard filla on February 27, 2004 6:41:15 PM] [edited by - graveyard filla on February 27, 2004 12:52:50 AM]

Share this post


Link to post
Share on other sites
Advertisement
did anyone look at the code? its what i was most concerned about. even if you dont know SDL just look and tell me because im doing a similar design to make a pacman clone now. thanks for your comments im glad someone found it entertaining

Share this post


Link to post
Share on other sites
i did pretty much the same thing you did a long time ago so i could probably look at it. But your site started crying about excedding transfer limits...cant look at it tell you get that fixed

Share this post


Link to post
Share on other sites
I had a look at the source, couldn't download the .exe for some reason. What i would advide to you is to split the code into different files instead of just the two you have know - perhaps split the code up into classes?

I would recommend splitting the Do_All_Collision() into separate smaller methods which will make it easier for anyone reading your code (and even yourself in a few months time) to see what is going on as a 308 line method is pretty big

EDIT: another slight improvement which will make your image blitting faster is to convert your image surfaces to the screen surface using SDL_DisplayFormat(), this returns a new surface so maybe write an image loading function which could load/convert the surface and optionally set the colourkey at the same time?

[edited by - Spudder on February 28, 2004 12:22:13 PM]

Share this post


Link to post
Share on other sites
hey spudder

thanks for going through my code. i appreciate at least one person helping me anyway, i didnt understand your last comment. what does SDL_DisplayFormat do? and how does it work? more details? what do you mean convert my image surface to the screen surface? i thought you could only have one image at a time on a surface? now im really confused. thanks a lot man. peace

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!