Game - Make The Snake Grow When It Hits Food
May 30, 2010I am simply trying to make the snake grow when it hits food, however, I am at a stand still.
[Code]...
I am simply trying to make the snake grow when it hits food, however, I am at a stand still.
[Code]...
I just started a snake game. This is what I have so far:
View 2 RepliesI often think of classes and modules as "global" variables or variables you can use any where in your solution/project. can you make global timers? I basicly want to make a farming like game but the plants will grow based on a timer. So if the player closes that form the timer needs to still tick. So can I make global timers so the timer would not have to start over if the form is closed and reopened?
View 4 Repliesim trying to make snake in visual basic.net for my major year 12 project in Australia and i cant get it to work?
View 5 RepliesI just finished my own snake game, and I need some recommendations on how to make this game better.If you see a problem, please tell me.The only problem with this game is that I can't get the code to get longer, other then that its good.EDIT: Sorry I meant : The only problem with this game is that I can't get the SNAKE to get longer, other then that its good.
View 4 RepliesI read the boundary thread and I think im still lost on how to do this but my goal is to set boundaries so the snake doesnt just keep going off the screen, also how to set a boundary up so the snake cannot hit itself (like in the original snake game)
View 4 Replies[URL].. to helping me in this game >>> plzi want some changes in that game >>* set the game as full screen .. not only form ..* change automatic moving to maneul...after throw a nurd, and change the players command colour for from defult"gray" to red and blue ...ect.* add textbox or lable or masgbox to add Questions "i've it"... as hiddenwhen nurd stop set as shown and the Questions change every time with nurd
View 2 RepliesIam doing a project for school (snake game) Ok here is the code:
[CODE]:................
Snake.image is the head of snake and snake2.image to snake27.image are the rest(body...) So i want create a code that (if snake intersect snake2 to snake27 parts) then timer1.stop I have tryed with:
CODE:
But it doesnt work..
I'm trying to make the classic Snake game in VB.NET, but if I hold a key (any key) during the game, after a few seconds the game freezes until I release the key. I've tried lots to fix this, but nothing works, maybe because I don't understand the problem.I'm assuming that when I hold down a key, the Form1_KeyDown function gets called, and when, after a few seconds, the key goes into "I'm being held down" mode, that function is constantly called, so the timers don't get a chance to update. But like I said, I'm probably wrong.
I've been struggling with this for a while. I think this is all the necessary code, please let me know if it isn't.
[Code]...
I am currently in the process of making a snake game using VB.NET... I was just wanting to gather ideas on how to do the body of the snake..Currently I have a class called SnakeBody which contains the following code:
[Code]...
I guess what I am asking is if Dim body As PictureBox a logical thing to put in my class. As in, I am not sure if that is the correct thing to do? To create the actual body of the snake I will have an array of these SnakeBody objects. If `'Dim body As PictureBox is valid How do I reproduce the same picturebox everytime my snake eats something?
I'm trying to make the classic Snake game in VB.NET, but if I hold a key (any key) during the game, after a few seconds the game freezes until I release the key. I've tried lots to fix this, but nothing works, maybe because I don't understand the problem.'m assuming that when I hold down a key, the Form1_KeyDown function gets called, and when, after a few seconds, the key goes into "I'm being held down" mode, that function is constantly called, so the timers don't get a chance to update.
View 10 Repliesim making a game for my assignment of snake. Vb10 Im coding 90% by teaching myself. Was just wondering if anyone has any idea how to help me. Im stuck with the array for making new pictureboxes and moving them to extend the snake here i some of the code.
Private
SnakeHead.Left = SnakeHead.Left + xDifference
SnakeHead.Top = SnakeHead.Top + yDifference
If SnakeBody(1).Left <> SnakeHead.Left And
SnakeBody(1).Top <> SnakeHead.Top Then
[Code]...
we were asked to create a game.Me and my friend decided to go ahead and make the game 'Snake' (I think you all know this one)Since we never had any teaching on how to do it we looked already made games and used the same code (we found this one on a Youtube tutorial so I think it was alright to copy it).We picked it because it seemed pretty easy and we can tell what each thing does in the code.I also like fooling around so I changed all he values and stuff so I understood better what was going on.The game goes great but sometimes when the snakehead touches the food it doesn't 'eat' it and I don't know why :This is the part of the code that takes care of eating the food.(PictureBox2 is the snakehead, PictureBox15 is the food)
[code]...
I just don't know why does happens. The PictureBox2 touches PictureBox15 but nothing of what I typed above happens.
[Code]...
The problem is I need to preserve all previous coordinates so I ReDim Preserve but I need to do it to the Class. And I try this and the NodeCoords variable is set as "nothing" when i am debugging realtime.
How do i create a byte array that grows?
Say I create a loop in a new thread and in that loop I using a blocking method to read data from a socket . I receive 255 bytes at a time, until all data has arrived. I want to pop this into one larger byte array after I have received it and whisk it off to somewhere else to do nasty things to it.
Is there a way to make the progress bar grow in value bottom to top?
View 2 RepliesOkay i only need to know how in the world do you make the snake move towards one direction at the beginning?
View 7 RepliesHow would i make a form grow down vertically like say 200px when i click a button ?
View 5 RepliesMy sister owns a small business, and (as a cashier) she is currently using hand written invoices for receipts and records. She knows I have some basic programming knowledge, and would like me to make her a program that would make it easier on her. Ultimately, it's going to log sales, and anything else to make taxes easier on her, which she is also doing manually at this time.
That will probably be a few weeks from now, for now what I want is to be able to have a Category, Subcategory, and Product system using ListView boxes. Ie. In the first ListView will be general categories, ie "food". Under the category "food", there will be the subcategories "pizza", "fish", and "pasta". Under the subcategory fish, there will be the products "salmon", "trout", and "cod". The user can highlight cod, click "add item" twice. The first time adding it to the receipt ListView box with a quantity of 1, the second time changing the quantity to 2.
Now the idea here is to make the contents of the ListView boxes depend on the selection in the preceding ListView box. If the user chose the Pizza subcategory, he would have the products "cheese", "pepperoni", and "mushrooms" in the product list box. If he chose "beverages" on the first ListBox (general category), he would get different choices entirely.
Of course these are not the items being sold, but they serve as good examples. I have a decent start on the program but have run into a few roadblocks. In each ListBox, there will be an "Add *" selection (activated by double click), which * will be the ListView it in. For example, they could go to the food category, double click the "Add Subcategory to food category" list item, bringing up a dialog asking for the subcategory name. They could then, in that subcategory, double click an "Add product to * subcategory" list item, bringing up a dialog asking for the item name, price, and flags such as taxability (some things such as services are non taxable). In addition, I want the user to be able to double click an existing item, removing it from the list.
I have a good start on the program, the interface is mostly done. My next step is to create some form of database to store the categories, subcategories, and products she adds. I could probably get it to work in runtime, but it would be a shame to have to redo it every time she restarts the program But this is where the roadblock is. I don't know what to do at this point, I've spent hours on Google before coming to this site. I will include the source so you can see where I'm at, at the moment.
I would like to make mechanism to prevent a logfile to grow bigger than 4 Mb. Therefore I compare the filesize, get with
[Code]...
With a string value saved in the registry. Now the thing is, that sometimes a backup of the logfile is made, while the actual size is 6 Kb, and the limit as saved in the registry is 4194304. ??
im trying to make a game in visual basic in which your character can move around, jump, and kill things. I can get the picture box with the character to move and everything is fine. but i did run into one problem. when the character moves over a tree (or something) you can see the gray backround of the character as i made in paint. how do i make the backround of the picturebox transparent?
View 4 RepliesI am trying to make a game which basiclly lets you shoot ducks. i have a picture as a background (set as form image) i then have picturebox's with ducks flying flying around you shoot them the disapear etc.
My problem is the image. i have a picture of a duck and a blue square round it. and i would liketo make it transparant because birds dont fly with blue squares.
Below is an image to illistrate my problem
I have tried adding transparent background, transparant key etc
I'm doing a project for school. I'm trying to make a game similar to the Impossible game. I need a square (picturebox) to jump but I want gravity to effect it.
View 1 RepliesI'm making this POS software for a restaurant and I was wondering what the best way to create the button interface for the items since it's going to use a touch screen monitor.
I was thinking of adding the buttons at runtime to solve the excess space problem, and also add the code at runtime, but that seems like too much work, so I thought I should ask if there are any other ways to approach the problem?
[Code]...
i am coding a program in vb.NET, it will be used for people to vot for their favourite food.I have let the users input the name of favoutie foods into an inputbox and tehn store the name of each favoutie food into an array called foodarray. Then the array outputs each item inside it into a checkedlistbox, which will be used to vote from by the voters.The problem is that i want to add 1 to the value of the name of the food each time it is selected by a user. How do i do this, i want to add 1 to the names in the foodarray to find out how many votes each food gets.
View 2 RepliesI need to make a matching card game in VB 2010. i have generated my cards but now need to show the cards for 10 secs then change the cards to (AppPath & "Cards ed.png"). then when a user clicks on the card the card will flip over.*How would i set a timer to turn all my cards into*(AppPath & "Cards ed.png") after 10 secsbut still have the values from the array and when i click the cards they flip over (from red card to numbered card)
Code:
Private Sub Place()
Dim Counter As Integer = 1
For Row As Integer = 1 To Int_Grid_Size
[CODE]..........................
I am looking for a nice way to display some help messages in my application and I was looking to have the user click a button. This would then trigger a area at the top to grow and show the help section. The only problem is i am not sure how to acomplish this.
View 1 RepliesI currently have 5 buttons at the top of my program's main form. They are all size 132x31 and fit perfectly in the window. However, when the window resizes I want them to grow and shrink proportionally to fit the new window size. I've played around with the anchor settings but nothing seems to be of help.
View 3 RepliesI'm trying to make a 2D game in VB. As a first step I'm going to make a playing field (a form) on which I will put a character. The character should be able to move up, down, left, and right when you press the arrow keys. How do I start off with this and what should I start off with learning?
I already know the basics in how to make normal apps with buttons, text boxes, labels and so on but I don't quite get how I should start off with something like this.Also I wonder about XNA and VB.Net. Can you use them together or is XNA only for C#? I found some stuff while googling suggesting that XNA for VB.Net had been released.
How can I set my labels to align on the right even when they have diffrent lenghts. I have a set of labels which are occuring next to each other and also underneath each other. The problem now is that they always align from the left within the label row,but I need them to align on the right as they are showing sums from other rows. Just to verify I am not talking about the text align I am looking for a solution to align my labels.
View 2 Replies