|
-
Nov 26th, 2010, 03:26 PM
#1
Thread Starter
Junior Member
Simple Terrain
I'm looking into making a simple 2D strategy game. It'd be tile-based. I've determined that each tile will take up apx 24 pixels and fit all together to make a grid.
My dilema is finding the best way of accomplishing this. I'm comparably new to VB, However I know how to create classes, Modules, and other such things. My original plan was to have each Terrain block be a modified PictureBox. However, somehow drawing 256 picture boxes on screen just doesn't feel like the right way of doing things, and seems to leave a lot of room open for errors.
Does anyone have any better ideas of accomplishing a tile-based terrain system that could provide for customizeable terrain types with various variables attached to them that could ideally be generated at runtime?
A friend of mine suggested drawing a large, grass image to be the base terrain, and several Terrain blocks would be drawn on top of this larger image. This would cut back on the amount of pictures being drawn, and would seem to be a bit simpler to work with.
My head is in a tailspin right now as this is the first graphically intensive application I've done, and am not really sure to begin here. Any expertise on the matter is greatly appreciated.
-
Nov 26th, 2010, 04:41 PM
#2
Re: Simple Terrain
You mentioned VB. VB6 or VB.net? If VB.net, then ignore the following
Take a look at your help files for the PaintPicture method.
Your form can be the gameboard or you may decide to use a picturebox as the gameboard. Each unique tile image can be loaded in a hidden image control or read from your resource file, if used, as needed. The bottom line is that you do not use 256 image controls, picturebox controls, etc. Just 1 per unique image.
You also may want to download some posted games in this forum section and disect how they were done.
-
Nov 27th, 2010, 11:47 AM
#3
Thread Starter
Junior Member
Re: Simple Terrain
I'm guessing VB express 2008 is just good ole VB6.
I was looking into DxICE, perhaps that would be a decent place to start my game off? My only problem is the lack of documentation that I can find on it.
-
Nov 27th, 2010, 01:39 PM
#4
Lively Member
Re: Simple Terrain
DXIce seamed to be pretty good to me as well. There is a bit more documentation in their forums (must be come a member though). Although most of the documentation is for C# not VB.
The one that interested me the most and I am just getting started with is SlimDX. It is a .NET object and currrently supports VS2010 but there there is little to no documentation just for VB.
Under the Demo's there are a few projects that were created with VB2008 and earlier versions. I would recommend looking those over to see what they are using for game engines. One thing to keep in mind, with VB2010 doesn't support DirectX anymore, so don't upgrade. While you can bring in DirectX as a .COM object it is completly broken down so the unexperienced like myself are completly lost and support is hard to find.
Good Luck!
-
Nov 27th, 2010, 01:43 PM
#5
Re: Simple Terrain
 Originally Posted by Kraizer
I'm guessing VB express 2008 is just good ole VB6.
Wrong guess I'm afraid... VB 6 was released in 1998, and was the final "Classic VB". VB 2002 and later are VB.Net
As such LaVolpe's suggestions aren't quite right (I'm fairly sure PaintPicture doesn't exist), but the general idea is still on the right lines if you write your own code rather than using a pre-made engine (or helper like DirectX).
-
Nov 27th, 2010, 01:56 PM
#6
Thread Starter
Junior Member
Re: Simple Terrain
I think I've come up with an idea.
I'm currently using a classe called "Map" that is a picturebox derivative. It then "creates" small objects ("Terrain") on top of it in 24x24 grid units. Being a unit-based strategy game, the units also snap onto the Map just as the terrain tiles do by simply getting the player's click position on the map and dividing it by 24, the terrain/unit tile size in pixels. the X and Y are figured out and the unit snaps to the grid.
In the process of tinkering with making Controls, I managed to clear out my toolbox . . . Any fies for this? Or will I ned to re-install VB2008?
Feedback on m ymethod is also welcome. The most pressing matter for he time being now is my cleared toolbox 
EDIT: Toolbox fixed.
Last edited by Kraizer; Nov 27th, 2010 at 02:07 PM.
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
|