I am writing a noughts and crosses game and everything works but the checkwinner sub routine, so basically if someone gets three X's or O's in a row then a message box pops up saying either X has won or O has won.Below is what I have written in the sub routine.
i have a two-dimensional char array that holds the values of a tictactoe board.Each element holds a value of either 'X','O', or and you can access the values with something like TicTacToewith the first bracket containing the row # and the second containing the column #.
Whats the best way to detect the winner of a TicTacToe game? I was thinking about just making a function like this Private Function checkWin(Byval TicBoard as Char) as Integer 'Return 0 if no winner, 1 if Player 1 wins, and 2 if Player 2 wins End Function Any ideas? I want to avoid using 8 if-else statements since that seems pretty inefficient and sloppy
I AM HAVING PROBLEMS WITH GETTING THIS PROGRAM TO DISPLAY THE WINNING MESSAGE. PLEASE ONLY REPLY WITH HELPFUL SUGGESTIONS HERE IS THE CODE I HAVE DONE
Public Class Form1 Dim flag As Boolean = False Private Sub Buttons(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click If flag = False Then DirectCast(sender, Button).Text = "X" flag = True
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?
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)
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.
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
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
I'm trying to make a 2D platform game and I'm pretty inexperienced at programming. I've coded the player to move left and right and jump, but I can't figure out how to prevent multiple jumps while the player is in the air. Anyone know how to do this?
Check Score: The winner is the one with the highest score less than or equal to 21If both scores(player total and computer total) are over 21, or if both are equal but under 21, the game is declared a draw.
There is something wrong with this line: If intPlayerCardTotal < intScore And intComputerTotal < intScore Then MsgBox "Draw"
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?
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.
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.
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.
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)
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.
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?
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
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.
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?
I am a student working on the venerable "Hangman" project. We were tasked to create a hangman game that would get a random word from one of three sources either by file, by array, or by database file. I have managed to get a random word to import from all three but I run into a problem once I start to play the game. The program seems to run into an infitinite loop as soon as you enter a letter or it automatically dispays character entered and gives a game over. [code]............
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)
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.
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
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)
I have created two fields (Panels) on my form and populated them with grid lines. Grid lines are calculated using the following variables: x1, y1, x2, y2.
Dimensions of each field are fixes and = 240x240, hence grid lines start at 20 and increment in the form of 20 * i (i from 1 to 11).
Now at this stage I have a problem, I want to create an Integer array with 10 rows and 10 columns, and I want each position in that array to correspond to a certain tile of my grid. (I will use that for the AI which will analyse the grid to see if a ship has been hit to work out next move, also see which cells are not available for shooting. For example, a 0 in the value of an array position will represent a tile on the grid that is available for the next shot, 1 will represent a ship and a 9 will represent the area around a sunken ship that definitely has no other ships in it)
As far as I understand it should be done using a function that would translate the co-ordinates of each cell of the grid in to a corresponding position in the array. But I'm afraid my knowledge are quite limited in this area, how can I put that in to practice? and also how can I highlight a specific tile when hovering mouse over it?
I'm making a speed card game [URL] for the final in one of my programming classes. I'm looking for a little assistance with how to go about getting it done the best way. I've included the code I have so far below. How does it look? What would you do differently? Would you do anything the way I did? I need to have one AI player and a human player.