Concentration Game VB With PictureBox Showing Pictures

Mar 15, 2012

The project: As one of the projects for my Advanced Visual Basic course, I'm implementing a Concentration game very much like this project:(url)

The issue: I've got most of the logic working but I'm getting really weird behavior when I flip the cards. The first one flips fine. The second one is *supposed* to flip and hold for a second (I use a Thread.Threading.sleep(1000)) then flip back to covered if they're not a match.

For some reason, if they don't match it never flips the second card over so that you can see the picture underneath. It evaluates correctly but if the pics don't match, you never get to see the 2nd card.

Secondary issue (not as critical): At lines 67-79 there are some bits of code that are commented out. I'm trying to use a For Each loop to go through all my picture box controls and assign them to the array of structures and then assign the cover image without having to do it one at a time. It would save me about 250 lines of code and help me to still respect myself in the morning.

In addition to including my code, I will upload a copy of the entire project folder in case anyone wants to compile it and see the behavior for themselves.[code...]

View 6 Replies


ADVERTISEMENT

VS 2010 Concentration Game 2D Picturebox Array?

Mar 13, 2012

I am required to make a game of concentration, whereby cards are shown for x amount of seconds and then truned over. The user then needs to remember where the cards were and pick two at a time in order to win points - whilst being timed.

Any pointers on where to start, or how to make a 2D control array of pictureboxes that can display the cards into a grid of (10x10) pictureboxes randomly?

View 8 Replies

Concentration Game - How To Use The Multiple Timers

Mar 12, 2012

In my class, we are designing a concentration game. The game will give you and output of numbers and you will have a specified time to memorize the numbers. Then, you will enter your guess to see if you were right or not. User will have the option to specify if they want a 3, 6, 12, or 24 digit number. Then they will be able to specify their own timer of 30 seconds, 15 seconds, 3 seconds, or 1 second. The options are done using radiobuttons.Groupbox 1 categorizes the number of digits long. Groupbox 2 is for the timer. So far, I have the whole game layed out except for the timer. Everything works.

View 11 Replies

Make Design Box For The Concentration Game In VB 2010?

May 13, 2011

I am trying to make my design box for the Concentration game in VB 2010. And do not know what kind of box to use, to show the cards that flip over.

View 4 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

Add Pictures Into Hangman Game?

Jan 27, 2011

I need directions on which code to use to load picture for each wrong guess.

View 5 Replies

Change The Tutorial 4 Matching Game To Use Pictures?

Aug 1, 2011

I would like to change the matching game to use pictures.I tried making a list of images but they are always visiable

View 9 Replies

Making A GDI++ Game - Monster(picturebox) To Go After The Player(picturebox)

Jan 14, 2010

Hey I am making a GDI++ game in vb.net. Now what I want is the monster(picturebox) to go after the player(picturebox). There Are No Vertical Walls. Only The Edge of map barriers. For example to get to the player the AI would have to go to the end of the ledge and either jump off and fall to the lower ledge or take the ladder down. There is no jumping, only falling and going up and down ladders and across the horizontal ledges. So How Can I make this pathfinding system?

View 18 Replies

2 Pictures In One PictureBox Control?

Feb 23, 2009

is it possible to have 2 pictures in one picture box ? the reason i ask is because im doin a lil project. it needs to have the picture change when it intersects with another picture

View 6 Replies

Get Pictures Fom Webbrowser To Picturebox

Oct 20, 2010

I am having a problem displaying some pictures (more than one) in a picturebox.

[Code]....

those picture links, shows like a number like 3308, and it changes every time the page loads. how can I display those pictures (next to each other) in a picturebox.

[Code]....

View 2 Replies

How To Generate Pictures In The Picturebox

Jan 28, 2010

I've got a little problem, with my picturebox (and dont know, if it's possible)I dont know, how to randomly generate pictures in a picturebox.I would prefer, that if i click a button, that one of my pictures appears in the picturebox (is this possible?)I'm not that experienced with visual basics (I use visual basic 2008), and already looked at the forum & some tutorials, but could'nt find anything..)

View 20 Replies

Add Two Pictures In A Single Picturebox And Display Them Simultaneously?

Mar 24, 2011

i want to add a picture of a field like a football field and on it a ball would roll (just like the football). i have loaded the field's picture in the picturebox , but m nt able to load the second picture i.e of the ball. how can i do this?

View 1 Replies

Cannot Attach Multiple Pictures In A Single Picturebox

Jun 21, 2010

i am trying to make screen saver in vb.net i m using picturebox and timer (for separation of time), but i cannot attach multiple pictures in a single picturebox.

View 1 Replies

Random Pictures In Picturebox Loaded From Resources?

Jun 28, 2009

I have a picture box and 10 images I want to load randomly. I cannot use imagelist because these images have a width of 400 and imagelist limits the width to 256. I have added these images to my.resources.The thing is I cannot figure out how can I randomly load each of these pictures to this picturebox

View 3 Replies

Random Pictures Loaded In Picturebox From Resources?

Jun 28, 2009

I have one little dillema: I have a picture box and 10 images I want to load randomly. I cannot use imagelist because these images have a width of 400 and imagelist limits the width to 256. I have added these images to my.resources. The thing is I cannot figure out how can I randomly load each of these pictures to this picturebox

View 11 Replies

Save Pictures From A Picturebox That Update Every 2 Second From A Screenshot?

Nov 21, 2011

here is some of the code that i have:

Public Function CaptureImage(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer) As Bitmap
Dim JPEG As New Bitmap(Width, Height)
Dim G As Graphics = Graphics.FromImage(JPEG)[code]....

when the timer hits a 2 second interval the picturebox on form 3 gets a new image from the screen shot that form 4 takes off of form4's area. i want the user to select a folder with the "folder browser dialog" and i want each frame capture to be saved to the folder (every 2 seconds) that the user chooses as "1.jpg, 2.jpg, 3.jpg" etc .

View 18 Replies

Display Pictures On PictureBox From Accdb File's Attachment Field?

Jul 29, 2011

I want to show pictures on a PictureBox. Pictures are stored on an accdb database's field (that field's type is "attachment"). Below you can find more details.

i have an access 2007 database (accdb), it has only one table named "TbResimler".

In that table, i have these fields;

Field Name Data Type Description[code]...

View 3 Replies

Showing Any Results In PictureBox?

Sep 11, 2011

I'm trying to change an image to black and white on a variable threshold for use in an ocr program. My problem is that I'm not seeing any results in the image that is supposedly processed. I do experience a small wait when rendering, so i am to assume that it is actually doing something.

Imports System.Object
Imports System.Drawing.Bitmap
Public Class Form1
Dim x As Integer, y As Integer
Dim imgx As Integer, imgy As Integer

[Code]...

View 1 Replies

PictureBox With Transparent Image - Showing Control Behind It

Nov 7, 2010

I am working on my game maker and I need to make it so that a picturebox with a transparent image will show the control behind it, like if the control has a image or just a color.

View 12 Replies

Showing Multi-page Tiff In Picturebox ?

May 6, 2011

I'm developing a program that will show multipage tiff in a picturebox using vb.

View 9 Replies

Load Game Images Without A Picturebox?

May 31, 2010

How do I load game images without a picturebox? (like in a game)I need them to be movible with the arrow keys. I am using a windows form, in VB 2008 express.

View 7 Replies

Game Programming :: Disposing A Picturebox From A Form?

Jun 24, 2011

I've tried so many ways to get rid of picture boxes for my space invaders game, yet it's not working. The bullet hits the alien, the alien goes invisible (which it should) but it doesn't go to a new location or get disposed. And the bullet then intersects with it again but because it's invisible the user just see the bullet reset out of no where and the score gets added which it shouldn't.

Code:
If Bullet1.Bounds.IntersectsWith(AlienArray(0).Bounds) Or Bullet2.Bounds.IntersectsWith(AlienArray(0).Bounds) Or Bullet3.Bounds.IntersectsWith(AlienArray(0).Bounds) Or Bullet4.Bounds.IntersectsWith(AlienArray(0).Bounds) And AlienHitArray(0) = False Then

[code]....

So, basically my question is how do I remove aliens (pictureboxes) off the board or disabled the picture box in space invaders when they are hit. (my bullet collision works fine).

View 8 Replies

Game Programming :: Making A Picturebox For Every Pellet?

Nov 22, 2010

I'm doing a pacman game and im stuck on how to make the pellets. This is the code i have so far.I was thinking of maybe making a picturebox for every pellet and then make an if statement that if pacman goes on a pellet it disappears and he gains a point. But this would be a VEERRRYYYY large if statement and im sure there is a better way to do it.

View 3 Replies

Game Programming :: Move An Object Around A Picturebox?!

Jan 2, 2011

how to make a collision between the player object and the wall which is a picturebox

i can move the player object (which is also a picture box) with the arrow keys and i've made it move inside the form border, but the porblem is how to make it stop when it touches the wall (picture box) if im moving left and the left border of the player touched the right border of the wall then it should stop and only the up, down and right keys will be working!!!

View 12 Replies

Game Programming :: PictureBox Access Between Forms?

Jul 29, 2008

I have been working with Visual Basic 6 for over a year and have just recently to move up to .net. I have never had problems viewing picture boxes that were on one form thought another.My old code read something like:frm1.img1=frm3images.treeThis would take the image of the tree from a form that is not viable and place that image in the imagebox.

View 10 Replies

VS 2010 PictureBox To Determine Items In Game?

Jan 21, 2012

[PictureBox] [PictureBox] [PictureBox] [PictureBox] [PictureBox].

All of them have no images. Now. I want to make an item editor for the game I'm playing. To edit the items, You have to place an ini file in the game's directory with the template below:

Quote:

[ItemSet1]
SetName=Set1
RecItem1=1028

[Code]...

And untill 6 - what after the = is the item ID. Each item has a unique ID for it (I have a list containg each item name and their ID).

Now what I want to do is: I have a listview on the left with each character in the game Image and Text. I also have a listview on the bottom with all the imgaes of each item and each text for the item.

I want to make it so when the user double clicks an item from the listview, It will automatically add it to the first picturebox (If it's empty). He can choose any item to add to one of the 6 picturebox's, When it fills one after one. When all the picturebox's are full, nothing will happen.

Now what I want is: How can I determine which "item" the user chose and according to that assign the item's picture to the picturebox, and then make a new ini file to set picturebox1's image's ID to RecItem1, picturebox2's image's ID to RecItem2 - and so on.

View 1 Replies

Game Programming :: Creating A Random New Point Within A Picturebox Bounds?

Jun 17, 2011

How do I go about doing this? I have currently made this code, but sometimes points are created on the boundaries of this picture box, which I do not want. I want all new random points to be within the bounds of this large playarea (picturebox). Foodarea is my big picturebox which i want all fruit to spawn WITHIN not outside on it's edges.

[Code]...

View 12 Replies

Game Programming :: Find The Properties Of A Picturebox That Was Created At RunTime?

Jun 19, 2009

I am working on a TCG card game and I am having some trouble of thinking how to find the Properties of a Picturebox that was created at RunTime through a Click Event.

Here is the Code I have This is the Sub that I have to create the Pictureboxes...

Code:
Private Sub CreatePictureBox(ByVal name As String, ByVal x As Integer, ByVal y As Integer, ByVal height As Integer, ByVal width As Integer, ByVal picture As String)
Dim PB As New PictureBox

[Code]......

View 2 Replies

VS 2008 - Minigame - Game That Lets The User Move A Picturebox Around With Arrowkeys

Nov 21, 2009

I've made a small game that lets the user move a picturebox around with arrowkeys. The monster picturebox is moved towards the player and keeps growing while you are "alive". If it touches you, you lose.

How to improve my code. Im the worst ever at OOP programming. The main reason is i dont understand how i can pass variables between subs/functions e.t.c. I've read up on overloading operators but i dont feel that i can grasp it. If someone has any comments or any simple examples on improving my ability i wouldnt mind hearing them ^^

This is what i have now. Attached project (with "graphics") without .exe files and all code is also below. Also an image of what it looks like below.

CODE:

View 3 Replies

VS 2010 - Create A Small Game In VB2010 - Creating A GIF And Placing It In The Picturebox And Moving It

Aug 9, 2011

I'm trying to create a small game in VB2010. The gameplay is as follows:

civilians would walk/stand in a room/street and suddenly an evil character would pop from the ground/wall. This evil character would suddenly vanishes too. So, the player has to shoot it to kill the character. The evil character, civilians, etc. would be random. Also, there would be sound effects too. That is the popping up of the evil character, it's voice, the civilians voice, etc. I'm trying to make it as simple as possible but without degrading the quality of the game play. I think, I could somewhat create the graphics for the characters, scenes, etc. and can get the sound effects recorded.

So, the difficult part is,[ ] how could I make it a smoother for playing the game ?
[ ] what would be the best way to do animations ?
[ ] Creating a GIF and placing it in the picturebox and moving it ?
[x]how to play the music in background and at the same time play sound effects on certain instance ?

View 2 Replies







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