Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a simple game RiceRocks which I want to translate into C programming language not C++,because I know C better. I know only basic C++ such as : loops,control statements, arrays. Where to start? What library should I use?

share|improve this question

closed as off topic by michael.bartnett, Trevor Powell, Sam Hocevar, Byte56, Maik Semder Jan 28 '13 at 17:23

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3  
This is fundamentally a hybrid "what tool should I use" and a "how do I get started" type of question, both of which have been deemed not useful on this site. If you google around for 2D game libs in C, you'll find there are plenty to choose from that are great. –  michael.bartnett Jan 28 '13 at 8:31

2 Answers 2

up vote 2 down vote accepted

If you have some knowledge of C and Python, the code shouldn't be hard to port. The only thing missing from the standard C which you need to write the game, is a graphics library. As you can see, the Python implementation uses something called simplegui which creates the window, loads images and then draws them. You can do this fairly easy in C using the SDL library. Here's a set of tutorials to help you get started: http://www.lazyfoo.net/SDL_tutorials/

Oh, and you need to transform the classes into structures. Just place all the members of the class in a C struct, and implement each method as a function that gets a pointer to the struct ( just as the python methods get a reference to self as their first parameter ).

share|improve this answer
    
Thank you for you answer. But are tutorials on lazy foo sutable for C? It seems that they are based on C++. –  Igor Zimenko Jan 28 '13 at 13:59
    
You are right, sorry. I remembered them being for C so I didn't double check. It seems the first 8 tutorials are only using C though, so they should be enough to help you get started. –  rootlocus Jan 28 '13 at 14:55

First off, saying "I know C better" is wrong because that doesn't sound right, and C is technically not better because it's missing a lot from C++ and it's not OOP which means classes and objects don't exist in it. Second off if I were you I would learn C or C++ until your great at it and then look into game libraries such as GLFW or GLUT or a C++ game engine like Irrlicht.

share|improve this answer
1  
I asked this question because my teacher want's me to translate this game into C. Ant I know the difference between C and C++. I just need some links on where to start. –  Igor Zimenko Jan 28 '13 at 8:41
4  
"wrong because that doesn't sound right" is wrong because that doesn't sound right –  Adam Naylor Jan 28 '13 at 8:41
1  
so can someone help ? –  Igor Zimenko Jan 28 '13 at 8:44
2  
First of all, all the libraries you mentioned, and the OpenGL implementation are written in C. Second, he didn't say C was better he said hew knew C better. Third, answering with "is wrong because that doesn't sound right" is not an answer. –  rootlocus Jan 28 '13 at 9:04
2  
Usually when you port a program one-to-one from one language to the other and you don't know the target language as well as the source language, you end up trying to apply the design philosophy of the source language to the target language resulting in very awkward code. –  Philipp Jan 28 '13 at 10:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.