Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: C Programmers Come Here

  1. #11
    shn's Avatar Ð3ƒμ|\|(7
    Join Date
    May 2003
    Posts
    3,568
    ROFL............notepad wannabe? What do you think most text editors are. Ms has put out some shitty apps before but notepad is pretty good. It has all the basic features that a text editor should have and its has a few others that dont make it bloated.

    I use text editors for editing config files not writing novels. Thats what word processors are for. And with all do respect if you cant code a simple notepad wannabe then you really shouldnt be trying to code anything thats more advanced than that because most of your time will be debugging it instead of actually finishing it.


    Hope that didnt offend you or anyone else but its the truth

  2. Software & Hardware   -   #12
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044


    Well I'm not making the text editor. I'm just making the game. That's where I need help at

  3. Software & Hardware   -   #13
    cselik's Avatar Poster
    Join Date
    Jan 2004
    Location
    Srbija
    Posts
    67
    my suggestion:
    (as i don't see x changing, throw ejex out)
    Code:
    case 'd':
    if (x<whaeva_limit_fits)
    {
      x+=7;
      ship(x,y);
    }
    ....
    word of advice: dont use delay, use some sort of time calc to make it smooth.
    then declaration shold be (for no warnings)
    Code:
    void salida (void);
    void menu (void);
    if you want enemies you should rename your prog to cpp and
    Code:
    class Enemy{
    int x,y,size,alive,etc...
    Enemy (x,y){ alive=-1; /*constructor stuff....*/}
    ~Enemy (){alive_=0; /*destructor stuff...*/}
    Draw(){ ...}...
    }
    and you can call it from prog
    Enemy sharman(1,0);
    if (sharman.alive) { sharman.Draw(); }...

  4. Software & Hardware   -   #14
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044
    Lololol Sharman. Ok, I just understood a little of what you said.

    Why should I rename it to .cpp? I'm doing C not C++ (although I know they can be compiled the same).

  5. Software & Hardware   -   #15
    cselik's Avatar Poster
    Join Date
    Jan 2004
    Location
    Srbija
    Posts
    67
    Originally posted by DWk@28 January 2004 - 02:36
    Lololol Sharman. Ok, I just understood a little of what you said.

    Why should I rename it to .cpp? I'm doing C not C++ (although I know they can be compiled the same).
    because u need objects to decribe behaviour.
    if u don't use objects you're going to be spending 20x more time writing your game in ansi, and will be filling up the memory with unnecessary variables.

    no .c and .cpp do not compile the same, from extension the bc knows how to parameter the compiler.

  6. Software & Hardware   -   #16
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044
    Ok then....can you explain again then, please

  7. Software & Hardware   -   #17
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044
    Bumping this.... I'm gonna have to do SOMETHING this weekend and I wanna make the enemy ships

  8. Software & Hardware   -   #18
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044


    Come on now

  9. Software & Hardware   -   #19
    cselik's Avatar Poster
    Join Date
    Jan 2004
    Location
    Srbija
    Posts
    67
    sorry, i was out in the nature playing, with no comp.
    so "explain again?"

    ok you need objects. i am not going to write them for u as u have an alternative not to do them OO-way, and i'm not gona be there on your exam.

    in order for OO's to work you need to rename a .c source to .cpp so compiler is called properly.

    you describe the behavior of each object inside a 'class'
    class Name
    {
    Name(){}
    or/and
    Name(int a){}
    or /and
    Name(char *t, int a){}
    are constuctors. you can have as many as u want, they are automatically called as object come and go in your game.
    automatically means if u call it with int the second constructor will generate the ojject

    ~Name(){}
    is a destructor. is automatically called when theres no need for the object to exist. btw you can call on it if u want to delete an object manually, is good when sth dies.

    Other_functions(){}
    can be added as well
    }


    you create an object like this:
    (class name is 'Name' and u want an object named 'willy' then

    Code:
    Name willy;
    or 
    Name willyz(2);
    these eill execute constuctor

    when u allready have willy named 'Name'
    then u can
    willy.Other_finctions;

    so if u understand these u can easily rewrite your game to be 50 lines and easily understandable, almost english (or spanish) -like statements.

    i really am not going to write it, nobody wrote my c homeworks back then. this is a thing you gotta go through and use with ease in the future.

  10. Software & Hardware   -   #20
    BANNED
    Join Date
    Jul 2003
    Location
    Guatemala
    Posts
    4,044
    Hmm..... ok I thought classes were in Java, not C.

    If indeed that is C and not Java, I assume they are defined almost the same way as in Java? With the exception that you don't put public..... etc. lol

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •