Write A Simple Game On Which The Player Has To Pursuit Some Figures On The Screen?
Oct 16, 2009
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...
View 11 Replies
ADVERTISEMENT
Sep 14, 2009
Here's my situation: I'm tryring to build a very simpe minigame in which the player has to pursuit and catch certain figures on the screen. This figures are currently showed as images on PictureBox wich i pass ByRef to some classes where the movement subrutines are. I have all the graphics in PNG, with transparent background, format and they look fine on the background, but when 2 or more of this figures are over the same place on the screen every PictureBox covers the underlying figure, so all i can see is one figure over the background.I was wondering if theres a way to solve this... Maybe using more powerfull libraries or something like that.
View 4 Replies
Nov 23, 2010
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.
Code:
View 3 Replies
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.
Private
Sub
Form_KeyPress1(ByVal[code]......
View 9 Replies
Aug 13, 2011
I said in a thread this week that I would set out to construct a program using the WMP component and this time, unlike in my last one, it is set up to allow any folder to be chosen. It's safe, even if the user chooses a folder with no .mp3 files in it, but it's goal is to look through all folders/subfolders, find the .mp3 files, get the path and the meta information about it, then show it in a listview.
The user has a few options such as playing the first song when a list is loaded, setting it to shuffle, etc., and all settings are saved automatically. Also, when they choose a folder to use to get their music, the next time around it remembers this also (although this latter one is done by saving the path to a text file so that you can, optionally, edit that before you send it out -- without having to change the code to do it).
I have it looking at events so that no matter what they change (click for the next song, change the volume, change one of the checkboxes, etc.), it will re-focus the listview so that the song presently playing is highlighted.[code]...
View 1 Replies
Apr 26, 2012
I am trying to create a simple DVD Player with Visual Basic 2008 (Express). But I am trying to find this item for the Toolbox-"MSWebDVD".
Does anybody have, like a download link to get it for VB 2008? If you do provide me with a download link, then I would kindly ask to tell me on how to apply it.
View 3 Replies
Aug 6, 2011
I've just recently started using VB.Net 2010 Express edition and Windows 7 Home Premium x64 and I'm trying to write a simple multimedia player. My algorithm is: Simple mutlimedia player algorithm: 1. Create a form with three listboxes (one for accessible directories, one for accessible files, one for INACCESSIBLE directories and files), a drive combobox (for a list of drives). A textbox for holding the file extension. A 'start search' button to initiate a search for the files. 2. Form load populates the comboBox with a list of all logical drives that are of type fixed and are ready. 3. The user selects a drive to search using the comboxBox. 4. The user enters a file extension in a textbox. 5. The user presses the search button. 6. The computer searches all directories starting at root for any and all files matching the file extension. The allowed read access directories are added to a listbox of directories. The allowed read access filenames (i.e. the full path of each individual file) are added to a listbox of filenames. 7. Once the files listbox is populated, clicking on a file in the listbox passes the full path of the selected file to another form which is opened and shows the ID3 v1 tags of the file in textboxes and also the obligatory open, play, pause, stop and close buttons. Plus an Edit Ok button which gets enabled if the user edits the ID3 v1 tags. 8. The sequence for playing the file is: open, play (then any of pause, play, stop), close - note that close also stops the file first if it is currently playing then closes it. 9. The user closes the playing form and goes back to first form (i.e. the search form). 10. Closing the search form exits the application. Ok I can populate the drives combobox no problem. I can get a list of directories ok I can't (and believe me. I've tried 100's of ways) seem to get a filelist of all the files in all the directories [starting at root] that match the criteria - that's the bit I keep getting stuck on. I keep getting an unauthorized access exception. Trapping that exception doesn't seem to do anything useful as I can't continue the search loop (OR get the filename that is causing the exception and add it to the files listbbox) - and so can't get any filenames. BTW I can open, play, pause, stop and close any given mp3 file (with a correct path) no problem using the Win32 API.
I know I've d/l a couple of file listers but they are/seem highly complicated for what should be a very simple task. In good old DOS, it would take a line or two of using the DIR or Tree commands to find the files so I can't believe that it is so hard to do in VB.Net It seems [to me] that Directory.GetFiles(searchpattern, startdirectory, option searchFolderDepth) doesn't properly work due to the exception which arises from the unathourised exception event (and which it then seems to be impossible of getting the filepath and then continuing the loop by simple exception handler code).
View 1 Replies
Nov 25, 2009
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.
View 2 Replies
Aug 16, 2009
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.
View 7 Replies
Apr 27, 2010
i am learning how to use the vlc plugin so i can make a simple media player but i am having trouble loading a video.[code]
View 2 Replies
Mar 21, 2012
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.
View 2 Replies
Oct 10, 2009
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).
View 7 Replies
Oct 27, 2011
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.
View 2 Replies
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
Aug 20, 2009
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...
View 3 Replies
Feb 17, 2009
I,ve been making this DVD Player everything is fine all the codes are fine but I can't put Full Screen on my DVD Player. I have been trying to work it out for a while but can't seem to do it. I have this button that says Full Screen and I'm trying to work out how i can click on the button and the dvd player goes full screen.[code]
View 10 Replies
Mar 17, 2012
I've managed to implement a formula that helps me to get the closest tile's distance that meets my requirements. The only thing is, I can't retrieve the actual tile for some reason... Tiles are named "Items" also. Here is my code:
[code]...
It puts green squiggly lines under ClosestItem and gives me the error: "Warning 2 Variable 'ClosestItem' is used before it has been assigned a value. A null reference exception could result at runtime."
View 7 Replies
Mar 30, 2012
I am creating a game which has a simple score system which I don't understand why it isn't working the way I want it to. When loading the game the User starts with 10 credits and for every time they run the game it costs 2 credits
This is my code for this below
Dim intCredits As Integer = 10
Dim intGamesPlayed As Integer = 0
intGamesPlayed += 1
intCredits = intCredits - 2
It has no errors but it doesn't take away the credits each time the game is played besides the first time. So when I run the game it will go to 8 credits, and it will stay on 8 credits even if I run the game again.
View 9 Replies
Apr 22, 2011
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.
View 11 Replies
Aug 16, 2009
I am making a little game for my friend in Visual Basic 2008. It uses 3 files (gamedataidname.txt, gamedataidlevel.txt, gamedataidgold.txt).
When the play button is clicked, I wrote some code to check if the file exists and display the content of the 3 files. This part works fine. But then I have a 'Else' statement to create the files.[code]...
View 6 Replies
Mar 30, 2012
I am creating a points system for a game, this is the code I have but it isn't working as I want it to.
Dim intScore As Integer = 10
Dim intNumOfGames As Integer = 0
intNumOfGames += 1
intScore = intScore - 2
The user will start will a score of 10, but everytime they click the button the user should lose 2 points off the score. But my code above that doesn't happen, when the user clicks the button it only happens once leaving the user with 8 points throughout the game.
View 1 Replies
Mar 12, 2010
I'm using Windows media player to display movies within my vb.net application - which works fine. But I have noticed if I double-click the movie it expands to full screen, which I don't want. I want it to stay in the window where I put it. I cannot find a setting that affects this,
View 2 Replies
Nov 3, 2011
Im still a bit newb to coding in Vb but Im trying to figure out how to make a simple inventory system for my video game. I need it to do a few simple things and Ive never made a inventory system before so im a bit lost on how to approach it.
Functions Needed:
Player has 40 pb that act as the visual inventory or display the item in that slot.
[URL]
I set up my armor menu to allow drag an drop of the item but again not sure how to even get the inventory system created to finish the armor menu to allow the object to be dragged into its box and remove its self from the player inventory.I think I need to make a array for 39 or 40 in my adventurestorage class. That part Im pretty certain of but how do I set that part up? I have over 200 images that need to act as a item that can be dropped into the inventory.
View 1 Replies
Feb 10, 2011
I'm trying to make a simple program that detects if a game closes, and when it does, it shuts down the computer.
View 1 Replies
Nov 9, 2011
[code]...
Yup,not PHP but it's the same for readability)As you may imagine I want to make a simple text based rpg game, but that's not an important fact.The buttons btn1 to btn3 are already created at the designer, and there are going to be other procedures which will assign values to their text property according to the game context (main menu, combat, shopping, training, etc.) you're at.Ok, so what I want to do with that procedure I pasted is to parse the text of ANY of those buttons when I click them, and according to its value select a case which will trigger another appropriate procedure (now there are only msgboxes as placeholders for testing only).My problem is that I dont know how to refer to the originating class of the handled event! I mean, let's say I click btn2. I'll want to immediately get the text property of that button only and use it as the value for the select case tree. I suppose I need to put something at that ?I wrote there, but I don't have any idea. The first time I was so naive to put me.text in there, and of course it returned the form name. Is there's something to do this thing...? I thought at first it would be a very simple task, but I'm going nuts searching for a solution so it's like if it was not possible, but I find hard to believe that, because this would be very useful, right? By the way, what I want to achieve is not needing to make a separate procedure for each button and to avoid as well the need to move any game option to another procedure if later on I want to rearrange the menus, because I expect the game to have more than three buttons actually.
View 2 Replies
Aug 25, 2010
I try to create a dual video player with VB 2010.
With that I have 2 forms, 1 main form (with all the controls and it should contain a preview screen of what is being displayed on the second form.
And a second form (with a windows media player component).
Now the main form should have (as told) a preview screen of what is shown on the second screen, I want to know if it is possible to have is as the windows 7 taskbar thumbnail (when preview the mediaplayer).
View 2 Replies
Dec 6, 2011
Respect, I should write a program for my keyboard player, which would have the option of changing sounds. So, the device is plugged into the USB, which lets you plug in 4 MIDI device or its keyboard. In order to select a song, a program should then all keyboards set the preset sounds. Is it possible to make? Do you perhaps know what we all need?
View 1 Replies
Jun 9, 2011
I'm making a simple game. I want simultaneously go up and left.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
' If e.KeyCode = Keys.Z Or e.KeyCode = Keys.Up Then
[CODE]...
Left, right, down and up work. now diagonal.
View 1 Replies
Feb 12, 2011
I just finished making a Tetris game in VB.NET, and I wanted to add a high score system to the application. So, when a user completes their game, they have the option of submitting it as a high score, which will compare their score against the previous high scores, then place it accordingly. I was thinking of an XML approach of doing this, where the user's name, rank, score, level, and number of lines cleared will be stored in tags. Here is what I thought the XML might resemble:
[Code]...
So the program will have an array to store all the previous scores. It will read through the XML, and copy the the score data into this array. Then, when the time comes to submit a score, it will compare this score against those previous scores, and find the proper position for that score, and then save it into the array. At the end, it will then copy all the score data from this array to the XML, replacing the <Level>, <Lines>, and <User> tags in the process.I am however having trouble implementing this, as I have no experience with XML files and everything I've read has been very confusing.
View 2 Replies
Nov 27, 2011
I want to make a simple screensaver but I looked at what others suggested on how to change screen resolutions and it seems a bit much. So I'm hoping their is a simple way to accomplish this task. Basicly I want the screen to fill reguarless of your screen resolution with the background image coded in the source code. I know the picture will look funny on large resultions but its a sample code Im making, so i'm not worried about streatching a image.My thought was do something to detect window bounds or something.
View 6 Replies