Game Programming :: Reset Button For Counter?
Dec 7, 2008
I am just creating a simple card game which uses three labels, which using the random function, generates random numbers and and assigns them to clubs, hearts, spades or diamonds. I have a counter which counts how many times the use has clicked the generate button using the following coding:
toclick += 1
txtTimesAttempted.Text = toclick.ToString
How can I reset the counter? Because I need a reset button...
View 2 Replies
ADVERTISEMENT
Oct 26, 2009
Ive been working on this for ages now i am supposed to b doing it in c# part i find it impossible so im doing it in Visual Basics
This is my current code atm:
Code:
Public Class Form1
Dim n As Integer
Dim oney As Integer
[CODE]...
Now i have the dice working and all that, the proplem is that to get the picturebox3 which is the players counter, if i do it the way im doing it atm its gonna take ages there must b a quicker way, i am thinking that arrays is suming i should use but im not that familier with them, i tryed this code using arrays:
Code:
bored(0) = PictureBox3.Location = New Point(210, 476)
bored(1) = PictureBox3.Location = New Point(270, 476)
bored(2) = PictureBox3.Location = New Point(320, 476)
[CODE]...
But when i tried clicking button 2 it didnt show the picture box at the right location it showed it at 0,0
View 10 Replies
Jul 20, 2008
I have created a game in VB.net 2005 that is very much like Sudoku. When the user clicks a button its number content increases by 1, when the user clicks the check button it gives them an error if incorrect, win if not. I need that same check button to apply the next action. I need to undo the last button click by the user when check is clicked. I know I need to build a container or something to record the button clicks and somehow draw on that when needed. hat I am even looking for, an 'undo' search returns nothing close to what I need.
View 7 Replies
Dec 20, 2009
I have a button named cmd_Grunt and a picture box named pb1_Grunt. I want to click the button and have a picture box created.
"Public Class Form1
Dim grunt = (50)
Private Sub cmdGrunt_Click(ByVal sender As System.Object, ByVal e As
[Code].....
This is the code I have so far. I get an error message, "Expression expected." It wants the expression between "CreateObject" and "('pb1Grunt', grunt))".
ie cmdGrunt_Click(CreateObject HERE ('pb1Grunt', grunt))
View 19 Replies
Apr 25, 2010
Okay my assignment is to change a code up using two functions instead of a subprocedure to calculate total rainfall and avedrage rainfall and then to add a startover button to the application which not only clears all the labels but also clears the counter and accumulator. This is what I have gotten so far my functions do not work and I can get the labels cleared. I just can't get the counter and accumulator to reset back to zero
View 1 Replies
Aug 4, 2011
I got how to do a count on a form. I want to display a counter onssagebox....MessageBoxButton.OK' to let the user know "hey xyz of Inserts were successful" and when they click the "ok" button it gets reset and starts over. I know i might be a bit off but here is what i got. Look ate the bottom portion
ButtonDialogResultSuccessfulInserts) and the top were i declared and set (
Dim countLaserInserts
As
[code].....
View 6 Replies
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
Oct 3, 2011
Im new to VB. how do I get to add the score.my code is
[Code]...
View 6 Replies
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
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
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
May 24, 2008
I was wondering if there is anyway I can get mouse coordinates when I click on a mouse button inside a listbox? I know how to do it in the form but when I click inside a listbox nothing happens.
View 9 Replies
Apr 18, 2012
On programming assignment without having any real experience in vb. I guess I don't understand subroutines that well. When the program runs it never goes to the computer's turn and does not update the users score either. This assignment is already in but would like to know what is going wrong. Using VB 2010, and this is windows application.
Code:
Public Class Form1
Dim Myturn As Integer
Dim Computerturn As Integer
[CODE]...
View 6 Replies
Apr 30, 2011
Upon changing the field size a game should restart. Upon trying to do so I see the previous grid (e.g. 10x10) displayed on top of the new one (e.g. 4x4). How would I prevent this and indeed start the game fresh?
View 10 Replies
Feb 4, 2011
So here is my problem. I have a vb game with animated sprites and all, and the character even jumps. However it only works in the y direction. So if i'm moving, he stops in place and jumps, instead of jumping forward. I was wondering if someone knew how to make him move at the same speed forward during the jump.
[Code]...
View 2 Replies
Apr 19, 2011
I currently have a who wants to be a millionaire game that I have made in visual basic 2010. Each question is in its own form. Form1 opens at the start, and question 1 is opened by a button click on Form1. The user has to click on the picture box at the side to show the text for the question each time. If they answer incorrectly, it displays a message box, opens an input box asking for their name, and goes to the form with the high score list, Form17.
Upon opening Form17, I want the scores to load and be displayed in the list box. The high scores are saved in a text file at C: est.txt . Upon clicking menu or end, the high scores are saved to the text file.
View 2 Replies
Apr 1, 2009
I m writing a video poker style game. the form consists of the player's 5 cards, a deal button, a hold button for each card, a button to select amount to play that hand. im using Visual Basic 2008 Express Edition.
View 10 Replies
Jun 4, 2011
I got on my form textboxes, checboxes but also a groupbox which holds texboxes.
The idea is to be able to clear and reset all of these by clicking a reset button.
At the moment i got this
Private Sub ClearFields()
Dim ctrl As Control
[Code].....
But ofc Me.controls isn't gonna get involved with the stuff in the groupbox.
View 4 Replies
Apr 18, 2010
im struggling to work out the code for 3 of a kind in my yahtzee game, i think that if i can work this out i can sort my everest of the full house code!
can someone tell me where ive gone astray?
code:
View 8 Replies
Jun 4, 2012
I am all new to Visual Basic 2008, I am trying to create a picture shuffle game, the problem is I cant seem to be able to move one picture from PictureBox1 to PictureBox2 onClick, here is a Code I written earlier:Sub ChangePicture(ByRef P1 As PictureBox, ByRef P2 As PictureBox)
[Code]...
View 1 Replies
Sep 11, 2009
Is there any visual basic 2005/2008 RPG games with the source code available for download.Could you possibly reply to this post with a link to the website with the game.Or is there a template i could use to try create a zombie style RPG game text or graphical.
View 2 Replies
Jun 3, 2010
I am developing a very simple game in visual basic 2008: a roulette. And yet I found problems in develop it.My question is this: I have an image ,containing all the roulette's numbers and I want to associate the spaces of the different numbers to different buttons, so that which time I click in a certain number on the image it dos some action.How can make this association of the different spaces in the image and different buttons?
View 3 Replies
May 14, 2012
basically i'm trying to move the Player by rotation.I have a perfect rotation system that works with a custom picturebox control that supports rotation that i have.
View 4 Replies
Jun 10, 2012
So I pretty much built the game, that was the easy part. I am having trouble entering a name on my first form(startup) and keeping track of the score on second form(game) and displaying it both combined on the first page with the current users score. Also the way it set up now if you are running the game for the first time it says can't find LowScores.Text. Start Up
CODE:
CODE:
View 6 Replies
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
Nov 16, 2008
I have been making a game similar to mario for learing perposes. I got the sprite to move left right up down but I still have no gravity nor can I jump. But i need to know how to make it so that my sprite dosent go through objects?
View 3 Replies
Mar 31, 2009
I'm making a game engine, its coming along pretty nicely, but I'm having trouble with collision detection.. This will be a platform game..I'm using GDI+ for my rendering.My rendering engine, basically draws upon a sprite class I wrote, this class is getting pumped into a collection, then I'm using a for loop to draw the images in the collection..
Code: Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Try For i As Integer = 1 To SCollection.Count Step 1 Dim Image As New Bitmap(DirectCast(SCollection.Item(i), clsSprite).Filename)
[Code]...
View 13 Replies
May 21, 2010
I am trying to create a card game on microsoft visual studio 2008. But i am finding it tricky to get the right codes for the generating button. The button wiill display three random playing card suites and when all three match the user is declared the winner.
View 5 Replies
Jun 3, 2011
Have attached the code so far and would like to be able to rotate my car sprite through 360 degrees and have it move in diagonal fashion.
View 19 Replies
Sep 8, 2008
okay so here's the go. i have to design the inventory system for a game and one of the things it has to be able to do is combine items together. the way i went about this was to give each item a binary ID (1,2,4,8,16,32,64,128) so that no item has the same ID. the cool thing about this is that you can combine items together and get a new unique ID like this:
if you have an item Stick with ID 8 and an item string with ID 16. you can say that these two combine together to create a bow with ID 24 (8+16).you can reverse the process and find out that the bow is made up of a stick and a string since there is only ONE way you can get the ID of 24 using binary.hope that makes sense, some of you have probably seen it before anyway the problem i found out with using this is that you can only have about 31items before the binary ID's get too big when using the 'long' type in vb.net, and that's not enough.
one suggestion was to use Hexadecimal. another i liked was something about creating a class that would manage several long data types linked together to create as many ID's as i needed. but i didnt fully understand this one enough to implement it
View 4 Replies