• Advertisement
Sign in to follow this  

Is this too much for VB? (help required)

This topic is 4415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, so I'm making a video game for my computer engineering class. We have to use VB (only language we've learnt so far). Originally I was making a pokemon battler. But I scrapped that. It wasn't very fun at all :P My new game puts you in the role of Death. there is no way to beat the game, it's just for fun. You can pick up different weapons and use them to kill the human. When the human dies you just prss a button and a new one spawns. Here's where I run into problems. I'm fairly new to VB and I don't really know what it is capable of (I've seen a 3D robot shooter made in VB....). Is it possible to create an image when the user presses a button and not just enable it so it appears, but actually create it? And also, collision. How do I do collision in VB where if you image runs into another one dissapears and one changes? I am also adding two mini-games in hopes for bonus marks (though I already have a decent enough mark, I want to raise it) The first mini-game is called Death Spits (the whole game is called Death Bites) and the story is there are zombies and you spit acid, yadayadayada. Now, I was originally going to do an arcade style shooter for this where zombies just pop-up out of nowhere and you shoot them. I can do that. But I was thinking of making it a small side scroller instead. With jumping and stuff like that. I run into a few more problems here... I can only make forms so big. Would I just make the image bigger than the form and have it scroll the image? Because if that's what i have to do, I don't know how hehe. And lastly, I want to make Death Dances. I got the idea whilst playing Dance Dance Revolution Ultramix 3 (love that game). I want to make it so arrows appear at the bottom of the screen and scroll to the top, and when they overlap the arrows on the top you press the button and get points. Again, I'm not advanced enough for this. I will maybe scrap the Death ances idea and just have the arcade shooter minigame(because the side-scroller and dancing seems too hard for me). but I do need to know about collision and creating images. Sorry if I seem really needy :( but I'm new and unexperienced. ONly one way to learn though :) Thank you in advance for any help. P.S. If you need any more information about what the game is about or what I'm trying to do, just ask and I'll tell you ;) I hope I've provided enough information.

Share this post


Link to post
Share on other sites
Advertisement
Yes, you could do all that with VB, especially VB.Net.

However I would urge you to consider a much narrower objective. That's really three projects and I think the mini-games are actually more work than the core idea.

Share this post


Link to post
Share on other sites
As far as technical stuff goes, you should probably use a conventional rendering approach and BitBlt. Simply clear and redraw the form each frame, using BitBlt to do the drawing.

Share this post


Link to post
Share on other sites
Ya, thats all possible, but how much time do you have to do this? This project could take a while. Just remember in game development, everything you don't know how to do when you start a project you have to figure out in development. Figuring out problems can take maybe a few hours to weeks to solve. When you make a game, it usually takes longer to make than planned. Be sure you arent trying to push yourself too much but I would definently reccomend trying to push your limits, thats how you get better.

Share this post


Link to post
Share on other sites
Thanks for such fast responses.

I've decided to just go with the side-scroller.

So, I know how to make the character move left, right, up or down, but how do I make it so the character only moves left when the left arrow is pressed, and nothing else?

And also, how would I make it so when the character jumps, they fall back down again. Would I use a timer?

I'm just trying to focus on movement right now. I actually don't know how long I have for this project, our teacher hasn't given us a deadline yet. I'm *hoping* to finish it within two weeks, at least enough to submit. But I will polish it even after the semester is over.

Thanks again.

Share this post


Link to post
Share on other sites
To make the character move all you would have to do is a switch statement something like this:

switch(Keys)
{
case Right:
player.x+5
break
}

You said you already knew how to make it move and since I don't know VB thats the easiest way to tell you.

I've never had to do jumping before but a way I think you could do it is have to picture move up with a variable and each time the player picture moves up you would just lower the variable until it gets to zero and after zero it would make the character move back down. So just add the variable to the player.x position and that should work. Something like that seems like it would work but I'm still a noob so it might not.

Share this post


Link to post
Share on other sites
I've previously done the sort of project you're trying to do.

I would recommend you have a game loop.

Don't use timers (the control) timers are *very* flakey.

Instead use something like getFreqCount() (I think that's what it's called)
This page has one persons (rather verbose) implementation. If you want to understand what's going on, search for a tutorial on it. By the way, the getFreqCount stuff is higher precision than getTickCount.

For key input, I'd recommend you use something like NeHe has done (keeps an array of booleans telling whether a key is currently being pressed. You set it to true on key down, false on key up.
In the main game loop, call some sub/function to process the key input, check for indexes being true in the array for the controls the user has selected (or hard code them.)

Do use bitblt, there's a tutorial here
There are better ones than this around. If you're confused, search for another on google.

For a side scroller, I'd use bounding rectangles when evaluating collision detection. (You're going to need some sort of "collision detection")

You might think of using tiled graphics, I've found that I got the best average speed blitting chunks of size 256x256 for the background (back in the P3 days, anyway). If you're scrolling around, draw only the visible blocks (duh).

Hmm, to eliminate flickering (the most efficient "standard" way I've found) :
If you're using vb6, create a "backbuffer" picturebox to blit to. Set its visible property to false, set autoredraw to true.
Make sure the form's autoredraw property is false.
in the main loop, blit everything to the "backbuffer"
at the end of the drawing (each frame) blit the backbuffer to the form.

You'll also want to look into the article time based modelling
(hmm, that link looked especially good at explaining the fundamentals, at first glance, anyway)

...

If you want to simplify this, take some shortcuts
1)hard code the controls
2)have a one-screen game, not a side-scroller, then you just have to blit the backdrop once each frame
3)skip the time-based modelling/movement approach, skip the timer, hard code the movement factors
4) hard code even more stuff... (this saves time, if you're just implementing "one last feature" but makes for nasty code, and, if you have any time at all, should be avoided. If it means the difference between a working product and a non-working product (or a fun product, and a not-fun product) then cut some corners at the end.

Have fun, learn a bunch, *next* time you code up a game, you'll have a lot more experience, and the process will be smoother (the code will also be cleaner/more organized)

-Michael g.

Share this post


Link to post
Share on other sites
Try Keydown Event and

Select Case Keycode
Case 37 ' Left Arrow Key
Case 38 ' Up Arrow Key
Case 39 ' Right Arrow Key
Case 40 ' Down Arrow Key
End Select

Share this post


Link to post
Share on other sites
I finally got around to checking out the BitBlt thing. It seems (from microsofts website anyways) that it is C++ only. Or is there a VB version that I missed? Because this project can only be in VB, and the only thing I need to do is figure out how to create and object from user-input. And get the jump to fall :P (it just keeps going up)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh VB6 does bitblt just fine. I know www.vbexplorer.com has a set of articles concerning bitblt and all the fun you can have with it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement