PDA

View Full Version : Any one know Visual Basic?



DiSoRdeR
10-25-2004, 04:18 PM
In my Visual Basic class were making our own projects, and I have no idea what I should do. Any one have any suggestions?

deadeye9
10-25-2004, 04:42 PM
Paintball Forum.

DiSoRdeR
10-25-2004, 04:46 PM
Paintball Forum.
How am I supposed to make that? We have only learned how to make pictures and just got into making basic games. I was thinking of making Pacman, but do not know how to make him move.

Will Wood
10-25-2004, 04:50 PM
Make.Calculator.
Make.a.paint.program.
make.a.screen.saver

or.if.your.nuts..pong.
expect.over.9k.lines

slade
10-25-2004, 04:51 PM
um, i know real basic... sorta... enough to make a slideshow of empress photos ;) . maybe you could try making a game like this (http://www.albinoblacksheep.com/flash/squares2.php) . its pretty simple.

OysterBoy
10-25-2004, 04:52 PM
I'm only just begginning to learn C+ / VBasic, but couldnt you (This is my pseudo-code interpretation) tag the W (or whatever key) to run process "-pacmanname- move West x 2cm" ? Obviously the actual coding would be different, but I'm sure you would need to tag your choice of key as Input, and not a process.... damn.. Is it process..? :tard: I'm such a big help..

Jonneh
10-25-2004, 04:54 PM
Visual basic is like programming for clowns!

an extremely simple way of getting something to move around a window is to set up a timer object and for every tick of the timer, adjust the .top or .left attribute according to what button you're pressing.

Try making a simple vertical shooter. You can make something follow the mouse in either one, or both dimensions by finding the appropriate mouse event thing, then moving whatever you're controlling to the X and/or Y returned by the mouse event. Very simple stuff.

Good luck!

edit: This works in the old skool version of visual basic. vb.net is much more oop, so I'm not sure things are as easy.

DiSoRdeR
10-25-2004, 05:17 PM
Try making a simple vertical shooter.
I was thinking about doing that, seeing as how we just learned how to :D But I was thinking of making pins, then I shoot a black ball up aka bowling lol

DiSoRdeR
10-25-2004, 05:52 PM
Nevermind on the bowling idea, going to go for space invaders. How can I make a spaceship move with the arrow keys? I will try to find out with the book, but theres a couple thousand pages :eek:

mikey101
10-25-2004, 06:14 PM
best way to check and see if a key is being pressed is using the API GetAsyncKeyState, code should look something like this:

'// Declare the API
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal KeyCode As Integer) As Long

Private Sub Timer1_timer() '// Timer sub routine - loop every 100th of a second
Dim ksRet As Long '// Define the Variable
ksRet = GetAsyncKeyState(37) '//Assign to arrow key (37 = left, 40 = down, 38 = up, 39 = right)
If ksRet = -32767 Then '//if return statement shows it's pressed then...
'//make spaceship move accordingly.
End If
end sub

woo..it's been a little while, so that may not be perfect but it's worth a shot. hopefully this helps some.

coopy18
10-25-2004, 06:29 PM
best way to check and see if a key is being pressed is using the API GetAsyncKeyState, code should look something like this:

'// Declare the API
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal KeyCode As Integer) As Long

Private Sub Timer1_timer() '// Timer sub routine - loop every 100th of a second
Dim ksRet As Long '// Define the Variable
ksRet = GetAsyncKeyState(37) '//Assign to arrow key (37 = left, 40 = down, 38 = up, 39 = right)
If ksRet = -32767 Then '//if return statement shows it's pressed then...
'//make spaceship move accordingly.
End If
end sub

woo..it's been a little while, so that may not be perfect but it's worth a shot. hopefully this helps some.

If I remember correctly this doesn't capture all keystrokes (though it captures most of them) - VB6 was really wierd about that.

Disorder, I would recommend that you pick something that is interesting to you. I have been working as a software developer now for 7 years and I still learn more from messing around on projects for me than I do any other way.

Throw some subjects out here that you are interested in and maybe we can help you come up with a project. Who knows, we may even give you some pointers on writing it. ;)

-coopy

mikey101
10-25-2004, 07:01 PM
If I remember correctly this doesn't capture all keystrokes (though it captures most of them) - VB6 was really wierd about that.
true, but for a small app with minimal ammount of code to loop through it shouldn't affect it too much. Only other way i know to capture key strokes is to do a system wide hook..and that gets pretty intense.

DiSoRdeR
10-25-2004, 07:21 PM
As on now we havent learned any thing hard, we learned to draw lines, circles, triangles. We drew pictures using those, and now we have learn how to make things "shoot" a ball. I would like to make a space invaders game or asteriods. Only one problem I wouldnt be able to make the alien ships or asteriod able to move around. Also the only way I know how to "shoot" is by having it come out of the mouse, is there a way to make like a little space ship shoot instead? And have its movements with the keys instead of the mouse?

OysterBoy
10-25-2004, 07:36 PM
As on now we havent learned any thing hard, we learned to draw lines, circles, triangles. We drew pictures using those, and now we have learn how to make things "shoot" a ball. I would like to make a space invaders game or asteriods. Only one problem I wouldnt be able to make the alien ships or asteriod able to move around. Also the only way I know how to "shoot" is by having it come out of the mouse, is there a way to make like a little space ship shoot instead? And have its movements with the keys instead of the mouse?


What about a simple target shooting game? Have it calculate points, and hit averages (Just cause itd be cool)

DiSoRdeR
10-25-2004, 07:41 PM
What about a simple target shooting game? Have it calculate points, and hit averages (Just cause itd be cool)
That would be cool, but I have no idea how to make something like that. The person necxt to me made a counter before, dont know how he did it though.

coopy18
10-25-2004, 07:44 PM
mikey101's post will work for the keystrokes...

As for the overall game flow, you could do something sort of like this (don't know how legible this is in a post. Let me know if this is what you are looking for and I can try to be more specific)

Gameplay is like this
-ships (rocks) falling from top to bottom
-user moves right to left
-user shoots straight up

Create these things on the form load
-Create a collection for storing laser shots (i would use a shape in vb6 that looks like a line)
-Create a collection for storing enemy ships (another shape object maybe a triangle)
-Create a user ship (yet another shape)
-Timer to maintain game flow

Do something like this when the timer fires
-Check for user (spaceship) movement and process that
--If moved left or right set the .left value appropriately
-Check for user fired shot
--If fired
---add a new laser shot to the collection
---Draw it on screen
-Update laser movement from previous shots
--For each item in the collection move it up .top ++
-Update enemy ship movements
--For each ship move it down .top --
-Look for laser to enemy collision
--if laser .top >= enemy.top + enemy.height AND laser.top <= enemy.top then
---if laser.left >= enemy.left AND laser.left <= enemy.left + enemy.width
----boom remove the enemy from screen and from collection
---end if
--end if
-Look for laser to user collision
--similiar to the laser to enemy collision
-Look for exit keystroke
--if exit key then end

hope that is of some use.
-coopy18

DiSoRdeR
10-25-2004, 07:52 PM
Coopy I will try that, but most of the things you listed I have never done before. Hopefully I will be able to. I wish I had Visual Basic on my computer, but I have to wait until tomorrow when I have that class.

coopy18
10-25-2004, 07:57 PM
Coopy I will try that, but most of the things you listed I have never done before. Hopefully I will be able to. I wish I had Visual Basic on my computer, but I have to wait until tomorrow when I have that class.

Alright. If you want any help, feel free to IM me. I think my profile has my IM accounts on it.

blackclown
10-25-2004, 11:50 PM
i am slowly learning qbasic ;)

DiSoRdeR
10-26-2004, 04:26 PM
i am slowly learning qbasic ;)
Whats qbasic?

blackclown
10-26-2004, 09:26 PM
a old , easy writing program my friend said 2 learn before i started learning C++. I am just learning from http://www.qbasic.com/qbindex.shtml

mikey101
10-26-2004, 11:53 PM
i'm almost positive texis instruments uses Qbasic for some of their calculators..could be wrong though :tard:

coopy18
10-27-2004, 10:02 AM
I am pretty sure that you can use QBasic on some of the Basic Stamps too. I have used the OOPics and they are pretty cool. I don't have much of an electronics background but I bet you can do some really cool stuff with those.
-coopy