Snake Game Freeze When Hold A Key Down?

Apr 8, 2012

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 Replies


ADVERTISEMENT

.NET Snake Game Freeze When Hold A Key Down?

Dec 24, 2011

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]...

View 3 Replies

Game Programming :: Snake Game - Get The Code To Get Longer

Jun 6, 2011

I 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 Replies

Game Programming :: Snake Game. How To Set Boundaries

Dec 9, 2010

I 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

Game Of Snake & Ladder. Vb?

Feb 17, 2009

[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 Replies

Project For School (snake Game)

Dec 6, 2010

Iam 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..

View 6 Replies

Process Of Making A Snake Game Using .NET?

Jul 23, 2010

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?

View 2 Replies

Snake Game Food-Making?

Mar 3, 2009

I just started a snake game. This is what I have so far:

View 2 Replies

VB Snake Game Troubles With Array And Growing?

May 26, 2010

im 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]...

View 13 Replies

Game - Make The Snake Grow When It Hits Food

May 30, 2010

I am simply trying to make the snake grow when it hits food, however, I am at a stand still.

[Code]...

View 2 Replies

VS 2008 Creating A Snake Game - PictureBox2 Touches PictureBox15?

May 21, 2010

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.

View 6 Replies

Game Programming :: Make Snake In VB For Major Year 12 Project In Australia?

Apr 3, 2008

im 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 Replies

Game Programming :: Loop Causing Application To Freeze?

Mar 15, 2009

I'm having some wierd problems with my Looping. I'm was using a thread to start a looping routine to sample the keyboard for pressed keys. The loop worked fine when I made a call to it from the thread in my form load routine. However when I just made a call to the samplekeys routine without using the thread my application will freeze and it won't load.I'm making the call in the form load routine. Private KeyThread As NewThreading.Thread(AddressOf SampleKeys)hen start the thread in the form loading procedure , but if I just make a direct call to the samplekey routine without using a thread my application freezes.Here is the the thread don't think there is a problem with it.

Public Sub SampleKeys()
Dim N As Integer
N = System.Environment.TickCount

[code].....

View 1 Replies

Hold A Card In Poker Game?

Jun 11, 2010

Anybody know how to hold a card in poker game?[code]...

View 1 Replies

Texas Hold Em Game - Input Box Pop Up And Ask For A Player Name

Nov 24, 2010

Im working on a Texas Hold'Em game and I am gonna make it so i can have 9 players in the game, I put 9 blank labels on my form and a button. What im looking to do is have an input box pop up and ask for a player name. That part is easy enough and i got that, now im looking for the most efficient way to put what i put in the input box into the 9 labels. Should i have multiple input box variables, each one to handle a label? I know thats not very efficient which is why i wasnt leaning toward that. What i had tried doing was having the input box fill a listbox, which i got that to work fine, but i ran into issues with loading whats in my listbox to my labels. Its my assumption since its trying to load the stuff in the listbox to a label before its even there, it gives an error such as the array is outside of the index. I tried a Do until loop to tell it to do the input box, fill the listbox, and then try to read from it but my problem came is what if only 5 players are playing and the program is trying to read 9 players.

View 14 Replies

Variable Is "Nothing" (Snake Game) - Preserve All Previous Coordinates

Jun 4, 2011

[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.

View 4 Replies

Make A Snake Move?

Apr 2, 2009

Okay i only need to know how in the world do you make the snake move towards one direction at the beginning?

View 7 Replies

Red Block Making Not Working-Snake?

Mar 11, 2009

I am currently working on a snake game. I am trying to make a red block appear every time you eat food a red block appears. If you hit the red block, you die. For some reason, food works, but the red blocks never appear

View 6 Replies

Make Application Working Better And Never Freeze / Make Application Working With Any Count For Loop Without Freeze

Jan 19, 2012

I'm using loop to read data from sql and then make some calculations then save it again to another table but when application loop for 3 or 4 times it's freeze but the job is done but if loop = 10 or more then it is freeze and hangup for long time .i need to learn how to make my application working better and never freeze and make application working with any count for loop without freeze .

View 7 Replies

Drawing Grid - Moving Snake To Square?

Apr 7, 2009

I am setting up a snake game, I just like to know a few things. Do I require a GRID? and the grid needs to be the same size as the square obviously but how do you go about moving the snake to the square. I mean why do I even require a grid? Why cant I move the snake by its own size. Just need some clarification of the steps I should take to make my snake game. I would like to do this from scratch.

View 2 Replies

VS 2010 Snake Length Wont Increase?

Aug 15, 2011

I have a problem with snake game. I never tried to make a game with VB, but now i tried to make snake from this tutorial:So i added food to this snake game, and when i taking food, it increases score, but length cannot be increased and i don't know why. This code is in timer to check if snake head is on the food:

If p(m).X = food.Location.X And p(m).Y = food.Location.Y Then
score += 25
food.Visible = False

[code]....

View 9 Replies

Freeze The First Row?

Mar 27, 2011

I have a dgv, I populate it, and I insert a row at the pos 0. And I want to freeze this row even when the user sorts the dgv.

How can I make this? The frozen property alone seems to be not enough.

View 5 Replies

My GUI Became Freeze

Dec 22, 2008

Currently I have to retrieve over 2000 records from DB and bind with combobox. and then follow with another 3 retrieving (less than 20 records)

My problem is when I call this function, my GUI became freeze.

I try to use Application.DoEvents() method but it still didn't work.I read some post and pages, they mention about BackGroundWorker and .Net 2.0. But what i use it MS 2003 with 1.1 so i think i can't access BackGroundWorker.

View 10 Replies

Game Programming :: Make A Game In VB In Which Character Can Move Around, Jump, And Kill Things?

Apr 2, 2008

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 Replies

VS 2010 Game Multi-Client - Program That Enables A Game To Have More Than One Instance Running

Nov 18, 2011

I want to make a program that enables a game to have more than one instance running, where it would otherwise be unable to be done. How should I go about this? A sandbox? Hack?

View 3 Replies

Game Programming :: Adding Score To Rock Paper Scissor Game?

Oct 3, 2011

Im new to VB. how do I get to add the score.my code is

[Code]...

View 6 Replies

Repeat Cards Showing Up In Game And Win Evaluating Code For Poker Game?

Jul 2, 2009

I am working on a poker game and I have the game setup the way I want it in terms of graphics and I have the code programed to deal the cards out exactly how I want them. Granted, the code is very simplistic, but functional for a new programmer like myself. I'm sure there are other more efficient ways to code my game, but I like mine so far because I can at least understand the majority of it. With that being said, here are a few problems and questions that I have.

1. How come when all 12 cards are dealt out I have some cards repeating in the game? For example, I get queen of diamonds in more than one picture box when I only want the card to be dealt once and then removed until the next game.

2. I was hoping to have a button 3 to clear all the boxes, basically resetting the game to the next game. When I hit button 3 it only clears the contents of picturebox 10 and 12.Other notes: I have the deal down the way I want it. It deals the first 10 picture boxes and a second button deals the 11 and 12 picture boxes.

3. I know this is my next step so I want to post it with the code I currently have. I want to start taking my project one step further by evalutating each of the three rows of cards (3 rows of 3 cards each - I'm not worried about the dealers hand (picture box 10, 11, 12 yet). So I want to evaluate a row of pictureboxes against a "pay scale" and display the win in a text box or label next to the 3 card hand. For example, Q of diamonds, Q of Clubs, Q of spades would win 15, etc. ( have a weird feeling I may have to change the names of the cards (I have them named card1, card2, etc. right now) to something that identifies them in order to evaluate the hands.

Here is the code that I currently have. I'm using visual basic.

Public Class Form1
Dim Rndm As New Random
Dim myPB(11) As PictureBox
Dim HiddenCards As New List(Of String)

[code]....

View 1 Replies

Game Programming :: Prevent Users Typing In Random Letters In A Text Box-Scrabble Game?

May 4, 2011

I have created a scrabble game that generates random letters. For the user to type in a word using the random letters they have to type it in a text box.

I want my program to prevent users from typing in letters that are not provided in the text box and to allow them to type in the random letters that are provided.

View 4 Replies

Game Programming :: Spinning Reel - Fruit Machine Game For Windows Mobile Device

Feb 16, 2011

I'm trying to make a simple fruit machine game for windows mobile device.

I can create the game easily enough and flip through pictures in a picture box to display the correct symbol.. but what I'd like to do is do a proper spinning reel, but have no idea where to even start.

What I have is a list of images in an imagelist (or individual files) - what I'd like is them attached to each other and moving downwards, preferably as though it were going around a drum but just them moving would be a start.

View 7 Replies

Game Programming :: Transparant Images - Make A Game Which Basiclly Lets You Shoot Ducks

Feb 1, 2010

I 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

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved