Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Game Development
  4. Hey guys, mind telling me what you think of my first actual game with updating of movement?

Hey guys, mind telling me what you think of my first actual game with updating of movement?

Scheduled Pinned Locked Moved Game Development
15 Posts 11 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A andyharglesis

    BUT what about the program itself? Maybe less criticizing??

    P Offline
    P Offline
    Pete OHanlon
    wrote on last edited by
    #6

    andyharglesis wrote:

    Maybe less criticizing??

    Oh I'm sorry. I thought you wanted honest opinion from seasoned professionals. Your post title led me to assume you actually wanted our opinions. This isn't criticism, it's critique and is intended to help you grow as a developer. Trust me, I could have been harsh, but as you have made some effort I don't believe in crushing you. If you'd asked me to write the code, that would have been different. I'm not going to fire up an IDE, and copy and paste your code in just to test it - and you probably won't find anyone else here willing to do so either - especially when a cursory glance shows several areas that could be tightened up (as I explained in my previous post). I appreciate that you are young, and so are unused to dealing with people telling it to you exactly as it is, but you'd be better reading what I commented on and rewriting the code based on that - (I was coding in C long before you were born, heck I was probably coding in C when your parents were in high school). Once it's tidied up a bit, then perhaps people will be more willing to download it and try it.

    Forgive your enemies - it messes with their heads

    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

    P 1 Reply Last reply
    0
    • A andyharglesis

      Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.

      #include <windows.h>
      HDC hdc;
      HWND hwnd;
      PAINTSTRUCT ps;
      bool room1 = 0;
      short constupdate()
      {
      while(1)
      {
      InvalidateRect(hwnd, NULL, TRUE);
      }
      }
      int floor;
      static int x, y;
      int jmpjmp = x+5;
      int atpos = jmpjmp;
      bool right = 1;
      bool left = 0;
      void first();
      bool keyinroom = 1;
      bool havekey = 0;
      bool inmenu = 0;
      /* Declare Windows procedure */
      LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

      /* Make the class name into a global variable */

      = "CodeBlocksWindowsApp";

      int WINAPI WinMain (HINSTANCE hThisInstance,
      HINSTANCE hPrevInstance,
      LPSTR lpszArgument,
      int nCmdShow)
      {
      HWND hwnd; /* This is the handle for our window */
      MSG messages; /* Here messages to the application are saved */
      WNDCLASSEX wincl; /* Data structure for the windowclass */

      /\* The Window structure \*/
      wincl.hInstance = hThisInstance;
      wincl.lpszClassName = szClassName;
      wincl.lpfnWndProc = WindowProcedure;      /\* This function is called by windows \*/
      wincl.style = CS\_DBLCLKS;                 /\* Catch double-clicks \*/
      wincl.cbSize = sizeof (WNDCLASSEX);
      
      /\* Use default icon and mouse-pointer \*/
      wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION);
      wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION);
      wincl.hCursor = LoadCursor (NULL, IDC\_ARROW);
      wincl.lpszMenuName = NULL;                 /\* No menu \*/
      wincl.cbClsExtra = 0;                      /\* No extra bytes after the window class \*/
      wincl.cbWndExtra = 0;                      /\* structure or the window instance \*/
      /\* Use Windows's default colour as the background of the window \*/
      wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7;
      
      /\* Register the window class, and if it fails quit the program \*/
      if (!RegisterClassEx (&wincl))
          return 0;
      
      /\* The class is registered, let's create the program\*/
      hwnd = CreateWindowEx (
             0,                   /\* Extended possibilites for variation \*/
             szClassName,         /\* Classname \*/
             "Window's GDI Pixel Game",       /\* Title Text \*/
             WS\_OVERLAPPEDWINDOW, /\* default window \*/
             CW\_USEDEFAULT,       /\* Windows decides the position \*/
             CW\_USEDEFAULT,       /\* where the window ends up on the screen \*/
      
      R Offline
      R Offline
      Ravi Sant
      wrote on last edited by
      #7

      only 'Hall of Shame' is good place for this...

      // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫

      C 1 Reply Last reply
      0
      • A andyharglesis

        Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.

        #include <windows.h>
        HDC hdc;
        HWND hwnd;
        PAINTSTRUCT ps;
        bool room1 = 0;
        short constupdate()
        {
        while(1)
        {
        InvalidateRect(hwnd, NULL, TRUE);
        }
        }
        int floor;
        static int x, y;
        int jmpjmp = x+5;
        int atpos = jmpjmp;
        bool right = 1;
        bool left = 0;
        void first();
        bool keyinroom = 1;
        bool havekey = 0;
        bool inmenu = 0;
        /* Declare Windows procedure */
        LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

        /* Make the class name into a global variable */

        = "CodeBlocksWindowsApp";

        int WINAPI WinMain (HINSTANCE hThisInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszArgument,
        int nCmdShow)
        {
        HWND hwnd; /* This is the handle for our window */
        MSG messages; /* Here messages to the application are saved */
        WNDCLASSEX wincl; /* Data structure for the windowclass */

        /\* The Window structure \*/
        wincl.hInstance = hThisInstance;
        wincl.lpszClassName = szClassName;
        wincl.lpfnWndProc = WindowProcedure;      /\* This function is called by windows \*/
        wincl.style = CS\_DBLCLKS;                 /\* Catch double-clicks \*/
        wincl.cbSize = sizeof (WNDCLASSEX);
        
        /\* Use default icon and mouse-pointer \*/
        wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION);
        wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION);
        wincl.hCursor = LoadCursor (NULL, IDC\_ARROW);
        wincl.lpszMenuName = NULL;                 /\* No menu \*/
        wincl.cbClsExtra = 0;                      /\* No extra bytes after the window class \*/
        wincl.cbWndExtra = 0;                      /\* structure or the window instance \*/
        /\* Use Windows's default colour as the background of the window \*/
        wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7;
        
        /\* Register the window class, and if it fails quit the program \*/
        if (!RegisterClassEx (&wincl))
            return 0;
        
        /\* The class is registered, let's create the program\*/
        hwnd = CreateWindowEx (
               0,                   /\* Extended possibilites for variation \*/
               szClassName,         /\* Classname \*/
               "Window's GDI Pixel Game",       /\* Title Text \*/
               WS\_OVERLAPPEDWINDOW, /\* default window \*/
               CW\_USEDEFAULT,       /\* Windows decides the position \*/
               CW\_USEDEFAULT,       /\* where the window ends up on the screen \*/
        
        D Offline
        D Offline
        Dalek Dave
        wrote on last edited by
        #8

        Sucks. If I wrote code like that I would be ashamed to show it!

        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

        P 1 Reply Last reply
        0
        • D Dalek Dave

          Sucks. If I wrote code like that I would be ashamed to show it!

          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #9

          Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          D W 2 Replies Last reply
          0
          • P Pete OHanlon

            Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            D Offline
            D Offline
            Dalek Dave
            wrote on last edited by
            #10

            Maybe Pete, but I am not a professional developer like most here, but even I would recognise that approach as being completely sucky. And he did ask for an opinion. I gave my opinion.

            ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

            1 Reply Last reply
            0
            • A andyharglesis

              Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.

              #include <windows.h>
              HDC hdc;
              HWND hwnd;
              PAINTSTRUCT ps;
              bool room1 = 0;
              short constupdate()
              {
              while(1)
              {
              InvalidateRect(hwnd, NULL, TRUE);
              }
              }
              int floor;
              static int x, y;
              int jmpjmp = x+5;
              int atpos = jmpjmp;
              bool right = 1;
              bool left = 0;
              void first();
              bool keyinroom = 1;
              bool havekey = 0;
              bool inmenu = 0;
              /* Declare Windows procedure */
              LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

              /* Make the class name into a global variable */

              = "CodeBlocksWindowsApp";

              int WINAPI WinMain (HINSTANCE hThisInstance,
              HINSTANCE hPrevInstance,
              LPSTR lpszArgument,
              int nCmdShow)
              {
              HWND hwnd; /* This is the handle for our window */
              MSG messages; /* Here messages to the application are saved */
              WNDCLASSEX wincl; /* Data structure for the windowclass */

              /\* The Window structure \*/
              wincl.hInstance = hThisInstance;
              wincl.lpszClassName = szClassName;
              wincl.lpfnWndProc = WindowProcedure;      /\* This function is called by windows \*/
              wincl.style = CS\_DBLCLKS;                 /\* Catch double-clicks \*/
              wincl.cbSize = sizeof (WNDCLASSEX);
              
              /\* Use default icon and mouse-pointer \*/
              wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION);
              wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION);
              wincl.hCursor = LoadCursor (NULL, IDC\_ARROW);
              wincl.lpszMenuName = NULL;                 /\* No menu \*/
              wincl.cbClsExtra = 0;                      /\* No extra bytes after the window class \*/
              wincl.cbWndExtra = 0;                      /\* structure or the window instance \*/
              /\* Use Windows's default colour as the background of the window \*/
              wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7;
              
              /\* Register the window class, and if it fails quit the program \*/
              if (!RegisterClassEx (&wincl))
                  return 0;
              
              /\* The class is registered, let's create the program\*/
              hwnd = CreateWindowEx (
                     0,                   /\* Extended possibilites for variation \*/
                     szClassName,         /\* Classname \*/
                     "Window's GDI Pixel Game",       /\* Title Text \*/
                     WS\_OVERLAPPEDWINDOW, /\* default window \*/
                     CW\_USEDEFAULT,       /\* Windows decides the position \*/
                     CW\_USEDEFAULT,       /\* where the window ends up on the screen \*/
              
              T Offline
              T Offline
              thatraja
              wrote on last edited by
              #11

              Couple of suggestions for you. Best practices for programming in C[^] Standards and Style for Coding in ANSI C[^] C programming language coding guidelines[^] Applying Best Practices To Game Development[^] Game Maker "best Practices"[^]

              thatraja


              **My Tip/Tricks
              My Dad had a Heart Attack on this day so don't...
              **

              1 Reply Last reply
              0
              • P Pete OHanlon

                Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                W Offline
                W Offline
                Wayne Gaylard
                wrote on last edited by
                #12

                Well done! ...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....

                1 Reply Last reply
                0
                • P Pete OHanlon

                  andyharglesis wrote:

                  Maybe less criticizing??

                  Oh I'm sorry. I thought you wanted honest opinion from seasoned professionals. Your post title led me to assume you actually wanted our opinions. This isn't criticism, it's critique and is intended to help you grow as a developer. Trust me, I could have been harsh, but as you have made some effort I don't believe in crushing you. If you'd asked me to write the code, that would have been different. I'm not going to fire up an IDE, and copy and paste your code in just to test it - and you probably won't find anyone else here willing to do so either - especially when a cursory glance shows several areas that could be tightened up (as I explained in my previous post). I appreciate that you are young, and so are unused to dealing with people telling it to you exactly as it is, but you'd be better reading what I commented on and rewriting the code based on that - (I was coding in C long before you were born, heck I was probably coding in C when your parents were in high school). Once it's tidied up a bit, then perhaps people will be more willing to download it and try it.

                  Forgive your enemies - it messes with their heads

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #13

                  Pete O'Hanlon wrote:

                  heck I was probably coding in C when your parents were in high school

                  Ouch, Pete :laugh:

                  "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                  1 Reply Last reply
                  0
                  • A andyharglesis

                    Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.

                    #include <windows.h>
                    HDC hdc;
                    HWND hwnd;
                    PAINTSTRUCT ps;
                    bool room1 = 0;
                    short constupdate()
                    {
                    while(1)
                    {
                    InvalidateRect(hwnd, NULL, TRUE);
                    }
                    }
                    int floor;
                    static int x, y;
                    int jmpjmp = x+5;
                    int atpos = jmpjmp;
                    bool right = 1;
                    bool left = 0;
                    void first();
                    bool keyinroom = 1;
                    bool havekey = 0;
                    bool inmenu = 0;
                    /* Declare Windows procedure */
                    LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

                    /* Make the class name into a global variable */

                    = "CodeBlocksWindowsApp";

                    int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nCmdShow)
                    {
                    HWND hwnd; /* This is the handle for our window */
                    MSG messages; /* Here messages to the application are saved */
                    WNDCLASSEX wincl; /* Data structure for the windowclass */

                    /\* The Window structure \*/
                    wincl.hInstance = hThisInstance;
                    wincl.lpszClassName = szClassName;
                    wincl.lpfnWndProc = WindowProcedure;      /\* This function is called by windows \*/
                    wincl.style = CS\_DBLCLKS;                 /\* Catch double-clicks \*/
                    wincl.cbSize = sizeof (WNDCLASSEX);
                    
                    /\* Use default icon and mouse-pointer \*/
                    wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION);
                    wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION);
                    wincl.hCursor = LoadCursor (NULL, IDC\_ARROW);
                    wincl.lpszMenuName = NULL;                 /\* No menu \*/
                    wincl.cbClsExtra = 0;                      /\* No extra bytes after the window class \*/
                    wincl.cbWndExtra = 0;                      /\* structure or the window instance \*/
                    /\* Use Windows's default colour as the background of the window \*/
                    wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7;
                    
                    /\* Register the window class, and if it fails quit the program \*/
                    if (!RegisterClassEx (&wincl))
                        return 0;
                    
                    /\* The class is registered, let's create the program\*/
                    hwnd = CreateWindowEx (
                           0,                   /\* Extended possibilites for variation \*/
                           szClassName,         /\* Classname \*/
                           "Window's GDI Pixel Game",       /\* Title Text \*/
                           WS\_OVERLAPPEDWINDOW, /\* default window \*/
                           CW\_USEDEFAULT,       /\* Windows decides the position \*/
                           CW\_USEDEFAULT,       /\* where the window ends up on the screen \*/
                    
                    S Offline
                    S Offline
                    slam Iqbal
                    wrote on last edited by
                    #14

                    too long post ...............................

                    1 Reply Last reply
                    0
                    • R Ravi Sant

                      only 'Hall of Shame' is good place for this...

                      // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫

                      C Offline
                      C Offline
                      charles henington
                      wrote on last edited by
                      #15

                      101 little bugs in the code :laugh:

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups