Results 1 to 9 of 9

Thread: VB Classic: Snake's Escapade [Source]

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    VB Classic: Snake's Escapade [Source]

    Language: VB Classic (VB 6)

    Taking NoteMe's Snakes tutorial, I implemented it and expanded upon it. It does what NoteMe's program did and more:

    • Multiple fruits for different values
    • Multiple power-ups
    • Tracks levels: increases speed as you level up
    • Tracks score: your snake gains body segments every 100 points
    • Simple help/about windows to provide control/gameplay assistance
    • /debug: Comes with a basic debug mode for testing/development


    I've tested it through the first two levels, and it behave a little unbalanced or unpredictable as gameplay continues. There are more things that I've thought about doing for it, but I may move on to another game/format unless someone is curious to see it developed. It come as is. Every function/sub is formatted and has a comment header with everything filled out except for Description, and it comes with a table of contents to easily find code that I grouped together (Game Loop, Image Processing, etc).

    Graphics are handled via three image objects and not bitblt, but all of the objects are tracked in corresponding arrays so you would probably only have to rewrite the image routines to make it behave that way.
    Last edited by Fedhax; Aug 8th, 2006 at 05:33 PM. Reason: Formatting title

  2. #2
    Addicted Member
    Join Date
    Jan 2006
    Posts
    247

    Re: VB Classic: Snake's Escapade [Source]

    I suppose I better give some feedback .

    The game has a minor bug that I am sure is easily fixable, but I am too lazy to fix it atm. Here is the code:

    VB Code:
    1. Private Sub GetCommandArguments()
    2.    
    3.     Dim ls                  As String
    4.     Dim lsCommands()        As String
    5.    
    6.     lsCommands = Split(Command$, " ")
    7.    
    8.     For [COLOR=Red]li[/COLOR] = LBound(lsCommands) To UBound(lsCommands)
    9.         Select Case LCase(lsCommands(li))
    10.             Case "/debug"
    11.                 mnuDebug.Visible = True
    12.        
    13.         End Select
    14.     Next
    15.  
    16. End Sub

    Error: "Variable Not Defined"

  3. #3

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    Re: VB Classic: Snake's Escapade [Source]

    Quote Originally Posted by Seraphino
    I suppose I better give some feedback .
    The game has a minor bug that I am sure is easily fixable, but I am too lazy to fix it atm.
    ...

    Add a declaration for li.
    VB Code:
    1. Private Sub GetCommandArguments()
    2.    
    3.     Dim ls                  As String
    4.     Dim lsCommands()        As String
    5.     [COLOR=Red]Dim li                  As Integer[/COLOR]
    6.    
    7.     lsCommands = Split(Command$, " ")
    8.    
    9.     For li = LBound(lsCommands) To UBound(lsCommands)
    10.         Select Case LCase(lsCommands(li))
    11.             Case "/debug"
    12.                 mnuDebug.Visible = True
    13.        
    14.         End Select
    15.     Next
    16.  
    17. End Sub

    I've made the change in my code, but I haven't uploaded a new version of the game since it is a single line change.

  4. #4
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    Re: VB Classic: Snake's Escapade [Source]

    giWindowStatus needs to be defined as well
    I set it as int, game seems to work ok now.
    Private Sub InitializeGame(Optional vbRunGame As Boolean = True)
    Truly, you have a dizzying intellect.

  5. #5

    Thread Starter
    Hyperactive Member Fedhax's Avatar
    Join Date
    Aug 2006
    Posts
    293

    VB Classic: Snake's Escapade [Source]

    Thanks for the feedback. I've made changes to the source code to get through those two errors. It compiled and ran for me so you shouldn't have any variable isn't defined type messages.
    Attached Files Attached Files

  6. #6
    Lively Member
    Join Date
    Aug 2006
    Posts
    65

    Re: VB Classic: Snake's Escapade [Source]

    Hey I did that tutorial and im working on m own with my own features as well...

    I couldnt figure out how to change the speed and saw that you have done that could you give me some help with that.

    My movement is the same as the tutorials ... so I dont know if you changed yours... but could you provide me with some code or help. THanks.

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