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


ADVERTISEMENT

Cant Move Objects With Arrowkeys When Buttons Are Present?

Apr 14, 2009

I am extremely new to VB but i have most of the basics down fairly well. I can create buttons and move objects with arrow keys, for example. I am using VB Express Edition 2008. What I am trying to do is make a very basic game. So far it was going great until a little problem stumped me [see title to see where i am going with this]. Before i added buttons onto the form i was able to move my little circle man with the arrow keys up, down, left and right. When i added buttons it no longer allowed me to do such things. Now moving the arrow keys only allows me to select buttons without the mouse. It is really frustrating because i have been working very hard on this and a problem this small could ruin everything! ;)

I was wondering if there is a way to move objects with arrow keys and use buttons on the same form and if so, how do you do it?

View 3 Replies

Game Programming :: Transparant Images - Make A Game Which Basiclly Lets You Shoot Ducks

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

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

Add A Control Like Picturebox Programmatically And Allow User To Move It?

Jun 5, 2012

How to add a control like picturebox programatically and Allow user to move it with mouse? on google but cant find anything. Thats why I am here. In my application user creates a picturebox and a label at runtime by selecting a file from drag drop. User can create as many files he wants. But the problem is that I dont know that how to move both picturebox and label to change their location in a flowlayoutpanel which contains these controls with mouse. I know that how to add a control like picturebox programatically but dont know how to move it. I add picturebox by:

dim picturebox as new picturebox
flowlayoutpanel1.controls.add(picturebox)

View 3 Replies

Move A Card In A Solitaire Game Using .net 2008?

Oct 5, 2009

How to move a card in a solitaire game using vb.net 2008?is there anyone who can help me out here?its just that im a beginner and i want to know more about vb.net when it comes to games specillay in cards like solitaire...

View 8 Replies

Game Programming :: Make A Game In VB In Which Character Can Move Around, Jump, And Kill Things?

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

Lets A User Browse And Choose A Folder?

Nov 8, 2011

Basically I need to make a program that lets a user browse and choose a folder, then I need a box that the user can then select the files to work with, then with the selected files I need to put them into a zip file. I'm trying to use a list view box but having all kinds of problems using the data in it.

View 2 Replies

VS 2008 Move And Resize The Picturebox?

Apr 17, 2012

The end user should be able to move and resize the image in picturebox in the same way as I do in my Form1.vb. (Design) *.

View 3 Replies

Write A Loop That Only Lets The User Only Click A Button 10x?

Jun 7, 2012

So basically i need to make a loop that only lets the user click it ten times then gives the answer to them.i was gonna use a DO loop that looks like this so far.

Dim counter as integer
counter = 0
Do until counter = 10
loop

and after that i'm kinda lost on what to do, i know that its needs to be if you click btnenter 10 times give the right answer and then your done.

View 3 Replies

Making A Game In Which The File Stream Gets A Certain File(lets Say A.txt)?

May 29, 2011

i am making a game in which the file stream gets a certain file(lets say a.txt) and it reads it, if it has certain values stored in the file it returns boolean(this is a function), then a sub procedure writes to the file using a streamwriter and a filestream using the same file. I am having problems, sometimes visual basic says that another process is using the file, this is before i closed the filestreams and the streamwriter or streamreader, then it gives me errors when i close the files, it tells me that it can't access a file that is already closed, i thought the filestream gets the file and lets the streamreader or streamwriter read or write to the filefound out the problem?

View 2 Replies

Create A Program That Lets The User Open A Text Document?

Apr 9, 2009

Ok i need to create a program that lets the user open a text document and lets him do the following. This is with Visual Basics 2008.

Count Characters
Count Lines
Count Words
Count All

I don't know how to get my program to count just individual words and i have no idea how to get it to do all 3.

[Code]...

View 5 Replies

VS 2010 Create An Application That Lets A User Enter As Much Grades He Wants?

Oct 5, 2011

I have to create an application that lets a user enter as much grades he wants. The grades are between 0 and 100 and they can't be negative. Whenever the user type -1, the application is done and it shows the average of the grades, the lowest and the highest grades.I absolutly have no idea where to start but i must be using loop/do/while.

View 4 Replies

VS 2010 Looping And Input - Lets The User Select A Folder

Sep 23, 2010

I have a little situation and i am not sure of the best way to do it.

- My program lets the user select a folder

- From that folder i need to select all .png files

- One by one i need to load them into a picture box, await a button press and then go to the next image.

The above that i have typed in red is where im not sure what to do. The other steps i can do.

View 7 Replies

VS 2008 MouseOver - Move The Mouse To The Picturebox To Show In Right Or Left A New Window

Jul 25, 2010

Form 1. I have 1 picturebox with image how to make when they move the mouse to the picturebox to show in right or left a new window (to read from form2) and when they moveout the mouse from the picturebox auto to close the window

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

Create A Console Application That Lets A User Enter 20 Names And Then It Sorts Them Out Alphabetically In Order?

Mar 25, 2012

I need to create a console application that lets a user enter 20 names and then it sorts them out alphabetically in order and then displays them.

Module Module1
Sub Main()
Const names As Integer = 20
Dim index As Integer

[code]....

View 2 Replies

Click A PictureBox And Then Move That PictureBox With Keyboard?

Nov 11, 2009

Ok, so I have a new challenge for the D.I.C. Heads. I'm making a simple little game using VB controls. I know it's not the best idea in the world but it'll have to do for now!

Here is whats happening. I've created a class that inherits the PictureBox control that I want to use to place my game pieces on the playing field.

Dim pbArmyUnit(0) As ArmyUnit ' ArmyUnit is a Class that inherits Picturebox now I create the playing pieces at runtime as needed and append them to the array. Player currently buys the units and places them on the playing field.

[Code]...

On a side note how can I look at a stack of pictureboxes all created at runtime to determine whats at a particular location? Example. I move my army unit over top of the picturebox that shows my forest. How can I tell what picturebox I just moved on top of? does that make sense? I don't need code for this just directions on looking at the right info so I can figure it out.

I am creating my terrain at runtime as well since it's randomly generated. and I'm basically making an array of 192 pictureboxes with the appropriate terrain image as well as some other modifiers. Just like with my armies above I've inherited picturebox and created a terrain class array, this way I'm able to add my movement modifiers etc, directly to the picturebox I place on the screen. It's these pieces of terrain that I want to be able to check before allowing the unit to move into them! to get movement costs etc.

View 3 Replies

VB 2010 Move The Game Peaces (graphics) Over Another Graphics Which Is The Game Board

Apr 7, 2011

I am trying to do a game application similar to chess, where i need to move the game peaces(graphics) over another graphics which is the game board. using the mouse. How can I do multiple layers of graphics and control their movement(without using direct x, i know nothing about it)? Note: I have visual basic 2010 express, windows xp home

View 1 Replies

VS 2008 How Do Messegebox Sub Items Lets Say Row2 Col 2

Nov 23, 2009

I have just a few questions about the listview control,how do messegebox sub items lets say row2 col 2 and why cant (at run time) I select items in col 2 but only col 1.

View 2 Replies

[2008] Creating A User Tool For A Game - Simply Shows Information About My Own Character

Feb 23, 2009

I am creating a user tool for a game I am playing (NOT a hacking tool, it simply shows information about my own character). I have a template of what I need to do with the data I recieve, here is the code, it is coded in PHP

function decode_style($r) {

//get gender
$gender_array = array('Male', 'Female', 'Male 2','Female 2','Male 3', 'Female 3');
$style['Gender'] = $gender_array[round($r / hexdec(4000000))];
//GET AURA

[CODE]...

Ok, I understand PHP a bit (As you know one programming language you can understand just about any) and this is what I have created from this

Dim Style As Decimal
Dim Rank, RRank As Decimal
Dim Gender, RGender As Decimal
Dim Aura, RAura As Decimal

[CODE]...

As you can see, it is receiving a single piece of data from a remote SQL server, I then need to run this data through the above calculations (Seen in the PHP file) although the answers I'm getting are incorrect.

Here are some simple instructions I got in what goes on between values:

gender :
PHP

[CODE]...

aura:
PHP

[CODE]...

View 1 Replies

VS 2008 Possible To Declare A Variable Using Text Of Lets Say A String As Name?

May 1, 2010

Is it possible to declare a variable using the text of, lets say a string, as the name?If u dont get it im looking for something like;Dim Var + string1 As PictureBox..In the code "Var" is the start of the name and "string1" is the end of it so if string1 was "Hello", the picturebox would have been named VarHello.

View 2 Replies

VS 2008 Let The User Be Able To Drag A Picturebox To One Of The Empty Pictureboxes?

Mar 17, 2010

I have an application where I have different picture boxes which the user can drag and move.I also have different empty pictureboxes.

What I want to do:I want to let the user be able to drag a picturebox to one of the empty pictureboxes. Also, If the user drags a picturebox to an invalid place (outside the bounds of any of the empty pictureboxes), the dragged picture box should return to its previous location.

So what I currently have is the usual drag-drop code and on the MouseUp event, I run this code (currently only checking for one empty picturebox):

If Not pbEmpty1.Bounds.Contains(Me.PointToClient(pbRemote.Location)) Then
pbRemote.Location = OldLocation
End If
(pbEmpty1 = Empty picturebox, pbRemote = picturebox that is dragged)

But it doesn't work, it doesn't care if the picturebox is inside the bounds of the empty picturebox or not, it still returns to its previous location...

View 4 Replies

Game Programming :: 360 Picture Move VB 2005

May 13, 2008

im currently making(or trying) Turbo Tanks from vb Express edition 2005 and I cant get my tank to move a full 360. I can only make it move 90degrees make a object move 360 and btw is it possible to actually make this game from VB 2005 [URL]

View 3 Replies

Game Programming :: Make An Object Move?

Aug 13, 2009

something like this

pctObject.horizontalPosition += 5

I just dont know the right syntax

View 2 Replies

VS 2008 : Export A Listbox (lets Call It Listbox1) To Excel 2007?

Mar 2, 2011

I'm trying to export a listbox (lets call it Listbox1) to excel 2007 and I'm having some trouble with it. Listbox1 contains just one column of items but the list itself is able to contain more 30 items.I have this script and it does something but, the most important thing doesn't show up: The list as in listbox1...

'Dim oExcel As Object
'Dim oBook As Object
'Dim oSheet As Object

[code]....

View 17 Replies

Build A Very Simpe Minigame In Which The Player Has To Pursuit And Catch Certain Figures On The Screen?

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

Game Programming :: Different Ways To Get The Background To Move With The Character

Jul 5, 2010

I have been working on an rpg for a while now and iv been experimenting with different ways to get the background to move with the character. I dont have any directx experience at all so im trying to stay away from using it so my question is, if i design a 2d background in photoshop is there any way id be able to insert the entire picture in a picture box and have the character always remain in the center of the screen as the background follows him. my one idea is to make the background image bigger than the picture box and have the picture box some how follow the character.

View 4 Replies

Game Programming :: Making A Picture Box Move Right Then Left?

Jan 20, 2011

I want a picbox to move across a screen then back to where it started (for a space invader game:

the following code is what I have for this task.

Code:
Private Sub AlienMovement_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AlienMovement.Tick
If Alien1.Location.X > 20 Then

[Code]....

I can't make it < because thats not logical, can't make it = becasue that doesn't work, can't make it > becasue then it will only bounce back once. Is there another variable I could use?

View 5 Replies

Make A 2 Player Game But Both Players Can't Move At Once Unless They Tap The Keys?

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







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