In my Visual Basic class were making our own projects, and I have no idea what I should do. Any one have any suggestions?
Any one know Visual Basic?
Collapse
X
-
-
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..?
I'm such a big help..

Unicorns are people too ...
Old Narhwals are people too ...
Grizzly Bears are people too ...
Caterpillars are people too ...
Baby Peacocks are people too ...
lew "My hand was a little shaky and I released too soon."Comment
-
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.Comment
-
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.Comment
-
If I remember correctly this doesn't capture all keystrokes (though it captures most of them) - VB6 was really wierd about that.Originally posted by mikey101best 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.
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.
-coopyComment
-
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.If I remember correctly this doesn't capture all keystrokes (though it captures most of them) - VB6 was really wierd about that.Comment
-
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?Comment
-
Originally posted by DiSoRdeRAs 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)
Unicorns are people too ...
Old Narhwals are people too ...
Grizzly Bears are people too ...
Caterpillars are people too ...
Baby Peacocks are people too ...
lew "My hand was a little shaky and I released too soon."Comment
-
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.Originally posted by OysterBoyWhat about a simple target shooting game? Have it calculate points, and hit averages (Just cause itd be cool)Comment

But I was thinking of making pins, then I shoot a black ball up aka bowling lol
Comment