Skip to main content
GameDev.net gamedev.net
🔒 Locked

tile based rpg

Started by vshammas Dec 27, 2001 at 2:43 PM 2 replies 250+ views
Original Post
vshammas
vshammas
hello everyone, i have a question for any visual basic game programmers...i want to make a game in visual basic (rpg) using 2d tiles. i have figured out some of the stuff with BitBlt and how to use that, but i dont understand how to create a tile-"map" with this. any ideas? thanks a bunch. vic
Beowulfthefallen
Beowulfthefallen
Why would you want to make a game in Visual Basic? It will lag if you want netplay in there.
krez
krez
first off, i would recommend learning DirectDraw7, as it is faster than BitBlt. but, the structure of your maps would be the same so:
your map will basically be a 2D array (or a few 2D arrays if you want layers) of integers, where each integer is the index of a tile graphic. you also need to have your tiles somewhere (i would put them all in one long thin bitmap) and some way of tracking which tile has what coordinates in the bitmap. for example:

Public Type TileType
Index as Integer
Left as Long
Right as Long
Top as Long
Bottom as Long
End Type

then, make an array (or collection, whatever) of these TileType structures, and fill them in with the proper info (load from a file maybe?). when you need to draw your map, you look up each tile index in the map array, find the right coordinates from the TileType array, and BitBlt/DDrawBlt from the bitmap to the form. there are a lot of customizations and optimizations you will want to do, but that is the guts of it.
there is a web site devoted to VB RPG programming, called The Blackhole, it is pretty good as it focuses on VB RPGs. unfortunately, lately i have had trouble connecting to the site, i don''t know if they have server problems or what. but, keep trying, sometimes it is there.
HTH.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
vshammas
vshammas
Thanks krez, that was really helpful. I now have a pretty good idea of what i should do. i think i have the blackhole in my favourites somewhere, will try to connect.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.