Thread: first *COMPLETED* game. (Nibbles)

  1. #1
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704

    first *COMPLETED* game. (Nibbles)

    Ok, My major problem is I tend to make "tech demos", where I just work on some aspect, and when Its finished I'm like, well thats the only reason I did this was to see if I could to that... And I just abondon what ever I was workin on.

    So I decided to make an (all be it, Simple) Game, Nibbles. Now its completed in the sense that its a full game, with a win/ quit/ and replay features.

    now, the quality of the game on the other hand, is a completly different story . I used win32 console for it, and the Sleep() function to slow it down, so the controll input (arrows) are pretty iffy.

    The point of the project was to finish something, and brush up on pointers / linked lists. I would welcome any comments on structure, classes (encapsulation), pointer, memory management, or linked list usage. I'll probably take suggestions on recieving input, or game improvement, but they will not be applied to this game, as the other comments will.

    I DO plan to convert this to a 2d directX application too.

    The .zip includes the sorce files (and list.h, list.cpp which became obselete in final builds of game) and the exe. to play, just press the arrow keys to move the worm. dont hit yourself or the borders. Also, the borders are supose to be the console windows edges, however my resolution is 1152 by 800 something.

    Thanks for your time.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  2. #2
    Sometimes you will be just going around and then all of the sudden the game ends Strange bug, I checked to make sure I wasn't running into myself.

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    now, the quality of the game on the other hand, is a completly different story . I used win32 console for it, and the Sleep() function to slow it down, so the controll input (arrows) are pretty iffy.
    Suggestion: Instead of Sleep, use a counter and GetTickCount() to determine the last update. That way, you can check for movement in between *rendering*.

    For example:
    Code:
    if (!m_pause && m_lastupdate + speed < GetTickCount())
    {  
        m_lastupdate = GetTickCount();
        RenderScene();
    }

  4. #4
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Originally posted by Munkey01
    Sometimes you will be just going around and then all of the sudden the game ends Strange bug, I checked to make sure I wasn't running into myself.
    Perhaps your running out of bounds, my friend who runs a different resolution and winXP (i am win98) tells me that the bounds are not the width and height of the console. Other then that, I cant think of a cuase for such a bug.

    Originally posted by Eibro
    Suggestion: Instead of Sleep, use a counter and GetTickCount() to determine the last update. That way, you can check for movement in between *rendering*.

    For example:
    Code:
    if (!m_pause && m_lastupdate + speed < GetTickCount())
    {  
        m_lastupdate = GetTickCount();
        RenderScene();
    }
    Thanks for the suggestion. I thought about some sort of getTickCount function but It was late when I finished what I had, I wanted to invest neither the time/ effort in changing input (all though it woulda taken not much of either).

    But I'm working on a directX version of the game which will use directInput and properly handle input.

    Thanks for trying my game


    IM still waiting for comments on the linked lists/ pointer management. Im not sure I used deletes at appropriate times or lacked them at inapropriate times. Any comments on that?
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by dbgt goten
    Perhaps your running out of bounds, my friend who runs a different resolution and winXP (i am win98) tells me that the bounds are not the width and height of the console. Other then that, I cant think of a cuase for such a bug.
    Yes, that's the bug. I had the same problem when I tried running full-creen in Windows XP. That's not your fault, hehe.
    Your game is playable and worth converting to nice graphics.
    The source code looks nice, but you really need to comment more. If not now, you'll need it later. Just a tip.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    I notice that while you're moving, you loses when you press the back button. The only exception is when you have length of 2 or 3. But a traditional snake game shouldn't allow you to go backwards.

    But realli neat game. How long did it take you?

  7. #7
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704

    2ish days

    I worked on it 2 days. The first day was designinging/writing and re-designing/re-writing the class structure and linked lists set up. (list.h,list.cpp being remminants of the first idea). That was probably 2.5 hours of work. The second day I put the game together in working order in about an hour or so.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  8. #8
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    In other words this is ur FIRST game. Or first *completed game. So you mean you've created games in the past that you didn't get to finish?

  9. #9
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    oh yeh.

    My first posts on this forum I made a scrolling terrain engine (console mode) that was my first c++ thing.

    Since then ive half finished 2 dx engines, and 1 VB engine (FROM ABSOLUTE SCRATCH).

    Ive done a 3D pong game in visual basic using the wild tangent 3d plug in.

    and a couple other things. But i've never finished them.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  10. #10
    Seven years? civix's Avatar
    Join Date
    Jul 2002
    Posts
    605
    Nice. I found no bugs, exept for only making it to 20 and then getting bored..or it may be just me.
    .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  3. C++ Game of Life Program
    By rayrayj52 in forum C++ Programming
    Replies: 16
    Last Post: 09-26-2004, 03:58 PM
  4. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM