Results 1 to 26 of 26

Thread: (2008) building a simple snake game in .net

Threaded View

  1. #1

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    (2010) building a simple snake game in .net

    Important note: The first few postings were 2008, but i switched to 2010 so while the code is exactly the same, you may not be able to directly load the project into 2008. I don't know for sure.
    This thread over the next few weeks will document the development of a really simple game written in .net. It will demonstrate the following programming uses:

    1. Doing custom graphics drawing in the paint event.
    2. Showing a simple game loop
    3. Using windows api with .net for input (specifically, keypresses)
    4. Later on, simple sound functionality will be added.
    5. Also, for flexibility, the game window will be able to be resized dynamically.
    So here goes:

    The game we will be creating is a Snake clone called "Wormy".
    More information on exactly what a Snake game is can be found here.

    It is pretty much industry standard to figure out the function of a program before you write it, then come up with a user interface. I know what functionality i expect out of the program, and have created a simple form with a score area on the left. It consists of a docked panel with 8 labels on it. four for text and four for various data feedback to the game player. then i added another control for the game area. A picturebox control. I docked this control in the center. Now i can set the form to whatever size i wish and the game area will resize to fit. The finished user interface is below: You will see i also added a command button. This will be used to start the game loop. I've since changed the caption to "Start". Also i set the image control's backcolor to brown because it's kind of dirtlike and it's a game with worms in it.
    Attached Images Attached Images  
    Last edited by Lord Orwell; Jan 19th, 2011 at 09:14 AM. Reason: changed title
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

Posting Permissions

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



Click Here to Expand Forum to Full Width