Make Two Player Game That Allows You To Move Both Player Objects With The Same Event?
Jan 19, 2012
So I am trying to make a program that allows you to move two shapes using two KeyPress events, one to move the first object and another for the second. It works, but it can only move one of the two objects, not both at the same time.
Well I am trying to make a 2 player game but both players can't move at once unless they tap the keys (can't hold the key down or the other person can't move). How would I fix this as well as being able to go diagonally.Would this work?:Declare a bool value for each keypress below the public class thingy. Then use keyup to turn the bool off and keydown makes it go on. Then for the first player and second player I check if they are on and if they are than go to that direction...I think I would need a timer for that part but I dunno...
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.
How could I start making a Go game? I just need some logic for it, and maybe some code, and then I can do the rest. How can you tell if an area is enclosed, which areas on the board are full, etc.? I also need ideas on how to find infinite capture/retrieve cycles.
I want to make an ingame menu. When you open a game a menu will pop up with a hotkey. I don't need you to do the work for me I just need a sample of a ingame menu with a hot toggle (ie: the menu doesnt need an interface, a black square that pops up with key).
I am creating a tycoon game where you start at the bottom and go up the business ladder. At the end of the year, the player can either, stay with him current job, get another job or go it alone. I would like to know how I can make the player either a 'job offer' or 'share offer' when they own their own business.
Public Class EasyPlayer Private Sub EasyPlayer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load System.Diagnostics.Process.Start("MediaPlayer") End Sub
How would I check if a player has won the game? I've figured out that there is only eight possibilities for X and eight again for O which makes sixteen in total.Here is what I've tried so far..
If Square1.Text + Square2.Text + Square3.Text = "X" Then MessageBox.Show("Player 1 has won the game!", "Player 1 wins!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End If
I thought that this code will only allow that message box to appear only if all of the squares have X as its text. But the message box appears when there is only one square with X. How can I make it so that the message box only appears when all 3 squares have an X.
I am working on a game using Visual Basic.NET and XNA. I am having trouble making the map scroll with the player. I can move the map at a square at a time(32x32) but I don't like the way it looks. I want to move at a fluid rate if possible. I want the player to be able to walk half-way through a square then see a half-square to either direction your moving. IE: Walking left, walk half-way through a square then to the far left of the map see half of the next square going to be drawn. But I don't want just half-way, I want to be able to just have fluid movement where you can walk to an 1/8th of the square and see the next 1/8th on the other side of screen if possible... To open this project and view you must have Windows Phone SDK installed can get it from Microsofts website......Note:Only up and down movement have been added into the game.
I create a mouse game for a single player. Set up a form with 4 rows of pictures boc controls. when a start button is clicked the mouse is "behind" one of the buttons while a stop image is behind 3 other picture boxes. The object of the game is to click the correct picturebox that contains the mouse. If the stop image appears before the mouse then the game is over. I don't understand how the logic works.
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.
I making an music player with a trackbar who gets oppdated while the music is playing. My problem is that I have to move a the trackbar button.
This is my code: Dim TotalSeconds As Long = CLng(Form1.Player.TotalTime) ' 274445 Dim CurrentSecond As Long = Form1.Player.CurrentTime ' 10497 ' maxp is the maximum x location on my bar Dim nyp As ULong = CULng(((TotalSeconds / maxp) - CurrentSecond)) TB.Location = New Point(CInt(nyp), 11) Why is it return INF?
I'm coding the game timer, but am noticing that the gameBall is undeclared and don't see it in the tutorial.Private Sub gameTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gameTimer.Tick
I'm currently trying to write a really simple game on which the player has to pursuit some figures on the screen. Since i'm just writing the prototype version i'm using a Panel wich i redraw 1000 times per second. Now, i want that every level is similar but not the same as past level, so i created a Level Class that contains the game objetcs of Player Class and the Figure Class, wich are the ones that have all the movement subrutines. So, with a Timer, 1000 times per second, i get the input from a joystick, pass it to the player objetc and update the position of the figure object. All this stuff is reported to an internal Panel that every level object has, wich i refresh and then pass it ByVal to the panel that the player actually sees. The problem i have is that after the first level ends, when the second level starts running, i can see the last frame of the fisrt level flashing behind the figures and it makes the game run a bit slower after every level. I tried keeping a copy of the inicial state of exterior panel and use it to clean the one i'm using on the levels but it didn't work...
I am making a 2D game that has a player (me) that shoots bullets (pictureboxes) and kills other enemies. The problem is that when there are many bullets on the screen it gets very slow because it has to move every picturebox.
I've been pulling my hair for three days trying to figure out what has gone wrong in what little code I have in my first attempt at both the minimax algorithm, and recursive calls in general (I'm relatively new to programming). Basically, I have everything working in the application except for the thing I wanted to actually learn and work on in it: The minimax algorithm. Basically, whenever a player makes a move, the computer will do one of two things:
If there is a winning move right next to it, it will use that move. Easy as pie. However, if this move isn't in direct sight, it will pick whatever move lets the player win. The exact opposite of what it should be doing. I know it's not coming from:
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?
im looking for some code that can enable a e.keyvalue event when a player hits an object on form but i also want the form to load with the e.keyvalue event disabled
Hey im trying to make a DVD Player with MSWeb DVD Class , i know how to make a DVD Player but im trying to figure out how to downlaod MSWebDVD Class to Vista.
this is my first post. I just recently got vb and wish to learn a lot about it but I have no references...(book, good tutorial etc) I have always wanted to make applications for computers ever since I got on one 5-6 years ago. (I know you need code but I have no idea where to start. But, I am a fast learner.)
Having worked out how to make a Windows Media Player in VB 2008, I have a new problem of exporting the file and debugging to play the music. I can add midi/mp3 files to the resources section so it works when I press f5 in VB itself, but opening from the debug folder (to save for other computers) loses all the music.