Thread: Re-design simple game

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    Re-design simple game

    Hi,i need help to convert this simple game from C++ code to C..
    Blockbreak-lin.tar.gz
    Please help!!

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    You don't "need help", you want someone to do it for you.

    And good luck finding someone that'll do that for free.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I have moved this thread to the Projects and Job Recruitment forum.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Given that it's 90% C code to begin with (no C++ classes to make it an interesting exercise) it should be easy enough for most people with basic skills to attempt.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    The question is why would you even want to do that?
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  6. #6
    Registered User
    Join Date
    Jan 2012
    Posts
    9
    Im new to C,sdl and i dont know c++,every tutorial like this game that i found is written in c++.

  7. #7
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by 4c0 View Post
    Im new to C,sdl and i dont know c++,every tutorial like this game that i found is written in c++.
    So learn C++, what is stopping you ?

  8. #8
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    My oh my, yet another young developer that plans to learn programming by writing an operating system.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  9. #9
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    Quote Originally Posted by claudiu View Post
    My oh my, yet another young developer that plans to learn programming by writing an operating system.
    Is "operating system" a new alias for "game"?
    Devoted my life to programming...

  10. #10
    Registered User
    Join Date
    Jan 2012
    Posts
    9
    Does anyone want to convert this?

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    What's wrong with trying it yourself?

    It would take 1/2 a day to just to a bit of research on the bit that is genuinely C++ to get the general idea of what it does. Hell, you could even put some print statements in there and figure it out through observation. Replace that code with some works-the-same C and you're done.

    If you ever hope to write your own code, you owe it to yourself to at least TRY this yourself.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to design a game?
    By jerimo in forum Game Programming
    Replies: 9
    Last Post: 02-15-2010, 01:32 PM
  2. Game Design
    By plutoismyhome in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 09-30-2007, 01:22 PM
  3. game design
    By ElastoManiac in forum C++ Programming
    Replies: 7
    Last Post: 11-14-2006, 09:31 AM
  4. simple simple design question
    By Chaplin27 in forum C++ Programming
    Replies: 6
    Last Post: 05-31-2005, 11:33 PM
  5. Im a Newbie with a graphics design problem for my simple game
    By Robert_Ingleby in forum C++ Programming
    Replies: 1
    Last Post: 11-23-2001, 06:41 PM