nibbles clone game

Hey JB,

No suggestions I'm afraid, although exploding fish are always good!! you have however made a new enemy in my boss as I'm going to have to explain to him that although I haven't quite finished the new data access components vital for the distribution of our products I have been performing an in depth and highly intellectual analysis of nibblets!!
 
I think JuggaloBrotha can make it connected if he is teaching how to make a nibble game using VB .Net. However, that way he needs to disclose some codes. I dunno whether he agrees or not, but he can always publish it under GNU license :D
 
kulrom said:
How this game is connected with the forum if i may to ask you?
it's not, but if there was enough interest in it and/or enough people asked for code samples on how to do this stuff then i was going to ask Neal if he would be interesting in including a vb.net gaming forum here

but so far (granted it's only been one day) i highly doubt that there will be enough interest to do something like that
 
Yeah i got some questions...

I have a similar game, not as amazing, and im having problem setting a reference to the tiles i already set. For example i need to no if a tiles coordinates equals a wall, or any thing i have drawn. Another is how can i make it so if it runs into its other parts it stops it. I can stop it i just can think of how to work it. Im very new with gdi so any pointers are helpful. dont worry im not copying but ive been trying to find this code out for a long time.
 
well i could help ya, because it sounds extremely close to my nibblets, except in nibblet's i'm not using gdi

nibblets is a ton of picturebox's and labels lol
all i do is loop through the form's collection and see if the "head" of the snake is within the boundaries of the labels (all the walls are labels)

though i want to get into gdi and i could probably make my game much better if i were to do it in gdi (now that i know all the logic of it)
 
Wow thats exactly what i used to do (yesterday) today i started GDI+ and i got everything down but using maxtrixes, and paths. I could easily post up my code for the game im making it uses GDI+ but it doesnt work the same because its drawing pictures and what i need is to make the pictures a path so you can tell if it hit something

EDIT

you said about the boundaries in the labels ive been trying that also but got nowhere. any help? I was trying to set the width and length to double and using that sort of info but it never worked. Anything is nice, :D
 
in nibblets i have a picture box named "picRedDot" to denote the "head" of the snake, this is the pointer for adding a new picturebox when the snake moves as well

so i use picRedDot to check all the labels on the form and see if picRedDot is within a boundry of one, if it is then the function returns True, otherwise False (False is good in this case)

VB.NET:
    Private Function CheckBorders() As Boolean
        Dim intcounter As Integer
        For intcounter = mintBaseObjects To mintStartSnake
            If TypeOf (Me.Controls(intcounter)) Is Label Then
                If CType(Me.Controls(intcounter), Label).Width > CType(Me.Controls(intcounter), Label).Height Then
                    If picRedDot.Top = CType(Me.Controls(intcounter), Label).Top And picRedDot.Left >= CType(Me.Controls(intcounter), Label).Left And picRedDot.Left <= (CType(Me.Controls(intcounter), Label).Left + CType(Me.Controls(intcounter), Label).Width) Then
                        Return True
                    End If
                Else
                    If picRedDot.Top >= CType(Me.Controls(intcounter), Label).Top And picRedDot.Top <= CType(Me.Controls(intcounter), Label).Top + CType(Me.Controls(intcounter), Label).Height And picRedDot.Left = CType(Me.Controls(intcounter), Label).Left Then
                        Return True
                    End If
                End If
            End If
        Next intcounter
        Return False
    End Function

short and simple:
mintBaseObjects are those objects on the form that will never be removed (like picRedDot) and i've also got integers that keep track of things like the snake's length and whatnot

so it loops from the baseobjects to where the snake starts (actually 1 less than where the snake starts)
then it makes sure the object is a label (which it always is, but better safe than sorry)
then the function finds out if the label's a horizontal line or vertical
then it checks the picRedDot to see if it's inside either of them
 
Ok couple questions.
What exactly is mintStartSnake? Im geussing mintBaseObjects is an array of the objects or maybe something else..
Everything i get.
 
mintBaseObjects is an integer that holds the number of objects that's on the form in the designer (these objects cant be removed from the Me.Controls, if they are, bad things happen)
so say i have 4 picturebox's, a label, and a statusbar on the form then mintBaseObjects = 6, meaning the first 6 objects in Me.Controls are these (cause they're added first so they're first on the list)

mintStartSnake is another integer that holds the location of the first reddot (not picRedDot) of the snake

think of everything in Me.Controls not as a collection but as a list:
picRedDot
picWhiteDot
picPurpleDot
picGreenDot
lblPaused
Statusbar1
'these first 6 items are remembered in the mintBaseObjects, i've hard coded this
lblWall1
lblWall2
lblWall3
lblWall4
'in a NextLevel sub that handles creating and placing the walls i have another integer that's used to count the number of walls which at the end of the sub mintSnakeStart = mintBaseObjects + intNumWalls
anything added to Me.Controls is going to be a part of the snake which doesnt matter a whole lot here
so to get the walls for that function i posted in my previous post i use: everything between mintBaseObjects and mintSnakeStart

god i hope that make sense, i should probably write a tutorial on this :)
 
Nice game :) I actually remember an even more basic version of this game called Snake on a Vector many many years ago.

A couple of things:

1) The bottom wall is not showing - I don't know if this is intentional or not.

2) On level 10, hardest I went through a bug and it didn't disappear.

3) Too many free lives.

4) In the original and other versions of this game, if you tried to go back into yourself, it killed you instead of just ignoring the keystroke - you might consider this as it makes it harder.

5) You might consider allowing alternate keys as laptop keyboards can be very different.

Obviously the only bug was #2 and the others are programmer preference, but you did ask for suggestions :)

It's fun though and very well done - thanks!
 
{IP}Gil-Galad said:
Well i got level1 done for this thing im making if your interested in seeing it. The codes very short but it does alot. its all gdi+ btw.
actually i would be very interested to see the code, i'll post a form from nibblets so you can see how i did it using the objects


MyForumID said:
Nice game :) I actually remember an even more basic version of this game called Snake on a Vector many many years ago.

A couple of things:

1) The bottom wall is not showing - I don't know if this is intentional or not.

2) On level 10, hardest I went through a bug and it didn't disappear.

3) Too many free lives.

4) In the original and other versions of this game, if you tried to go back into yourself, it killed you instead of just ignoring the keystroke - you might consider this as it makes it harder.

5) You might consider allowing alternate keys as laptop keyboards can be very different.

Obviously the only bug was #2 and the others are programmer preference, but you did ask for suggestions :)

It's fun though and very well done - thanks!
i did ask, and you're finally the first to point stuff like this out, thanx :)

1. i've had this happen on a few systems, with windows xp different themes screw everything up, i've got mine (everything) is set for windows classic, but if i change it to even the standard winxp theme (Bliss i think is the name of it) then i also lose the bottom line on nibblets i have no clue on how to over-ride the windows theme display on my nibblets windows :( i've been aware of this since the beginning unfortunatly lol

2. i havent had this problem yet, but i'm deffinantly going to look at it, which game type was it? classic or maze? (both have a level 10)

3. i was thinking that too and i agree, i'm going to dumb it down some

4. actually i have the source code to nibbles (the very first snake game ever created, microsoft 1986 or 1987) and in nibbles if you're heading in a direction and you hit the opposite key it's disregarded, ie if the snake is heading up and you press down, it's disregarded, you can only hit right or left for it to take action, i did model it that way too but i might make it level difficulty prone as in if you're playing beginner then it's disregarded but if you're playing advanced then it'll kill snake

5. now that it's been pointed out, laptops do have different key configurations i should inclue W = up, A = left, S = right, Z=down as well as up = up, down = down lol

thanx for the feed back keep it comming :)
 
Back
Top