|
-
Dec 7th, 2012, 07:39 PM
#3
Re: [Question] How to make a movable character in vB
What kind of technology are you thinking of using, and which language? I guess you did say VB, and I would guess that you mean VB.NET, so will this be just using GDI, or will it be using something like XNA? If you haven't decided, the key question you have to decide on is this: How many total sprites will there be on the screen at one time?
GDI is VERY simple to get up and running with, but the performance will be horrible if you are drawing lots of sprites, or very large sprites, and doing so quite often. If you have one solid background image that doesn't change, or changes only very rarely, and the walking sprite you talk about is not HUGE (as it probably is not), then GDI would be easier, and should work fine. If you have a busy scene full of dynamic items that can change periodically, then GDI is probably going to make the result very laggy. I was working on a project that had up to about 200 rectangles drawn on the screen. The user could zoom in or out, which required redrawing many, or all, of the rectangles. The rectangles, themselves, were kind of complicated to draw, and the performance under GDI was horrible. In this case, I created all the images at each zoom level on startup, and swapped in the proper image when the user zoomed, which turned out to work pretty well, so just drawing the images wasn't bad, but composing the images was.
Recently, I reworked the interface using XNA. XNA was originally C# only, and virtually all examples will be in C#, as will all the templates, currently. I have it working in VB, so it is possible, but it's an odd animal. Getting it going wasn't too hard, though I still have some questions about it, so I haven't posted the code I used to get it going. All the code was based on examples that I linked to in other threads here in the gaming forum (and I have only about two threads, so they shouldn't be hard to find), and tutorials I found that really didn't apply to what I was doing, which involved using XNA to draw individual controls on a Windows form. The result was this: XNA is so much faster than GDI that I was able to drop the pre-rendering of all the images. Instead, when the user zooms, XNA composes and draws the 200 images on the screen as fast as I could ask for. So you pay in complexity and lack of examples, but you gain considerably in performance.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|