Continueing maps

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
GnosisX

Continueing maps

Post by GnosisX »

Hey guys i've never posted here but I need some help , This is most likely a very basic question but i can't seem to figure it out. Ok so here is the deal I have a map very similar to the one that is in DarkDreads tutorial (http://www.petesqbsite.com/sections/tut ... g_tut2.txt)
at the bottom he says that you can make it so that when the character walks to the edge of the screen it goes on to a new map. And i just cant seem to figure this out. What command/s would i have to use in order to achive this and if you know could you provide me with a small sample and tell me where to put the code in? Thanks alot guys you can also E-mail me the info (GnosisX@gmail.com) thanks again guys knowing this would really help get my project going!
Guest

Post by Guest »

If you think about the problem, you should figure it out...

But I think the main reason you haven't got it yet is because you aren't thinking about it in the right terms.

It's not so much 'walks onto a new map', more a new map is loaded, and the character's position is changed so that it LOOKS like he's walked onto a new map.

Most programming problems, especially concerning games, are not re-creating reality (like walking from one room to another), but about making it LOOK like you have re-created reality.

my two bits,

matt
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Darkdread's tutorials are great, but once you get a grasp on it (one map), heres a tutor that you should look at, and memorize. I did, and it helped. I tryed to do that scrolling map thing when I was at Nebraska for my grandmas funeral... didn't work well... I remember that good ol' laptop... 133mhz. Very nice with QB... got DOS 6.22 on it now.

Anyway, the tutorial is at http://petesqbsite.com/sections/tutoria ... TILEEX.txt . It is just a program, but I printed it out and studied it, and it was worth it.
Image
User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm

Post by Zamaster »

A couple o' things to keep in mind here:

Number 1-
What the guest guy said, you walk off the bottom you reappear on the top
of the screen. Same goes for all other sides, walk off it and you appear on the opposite side.

Number 2-
Need not load 45 bazillion maps and tiles into RAM, every time you move into a new room load the new room/tile set. The delay that occurs when loading is so minor, nobody'll notice it.

Number 3-
KEEP MAPS CONSISTANT! If you walk from a spaceship onto a desert just cause its cool, your a loser. Plus, if half of a sprite is on one edge of the map draw the other half on the opposite map so it looks whole. Im so sick of seeing this messed up.

Number 4-
There are'nt just 1 or 2 magic commands that do this for you. Keep a map array that holds the index of each tile in it and a tile array that holds image/general data about every tile. So the number 1 in the map array might refer to the tile under "TileData(1)". Also, the map array needs to have layers so you can stack birds, on trees, on grass, ect... You draw tiles starting from the one on the bottom layer and you work your way up.

Number 5 - FOREVER
The list goes on

Good luck! Help you need, give you I can(yoda)!
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Zamaster wrote:A couple o' things to keep in mind here:

Number 1-
What the guest guy said, you walk off the bottom you reappear on the top
of the screen. Same goes for all other sides, walk off it and you appear on the opposite side.

Number 2-
Need not load 45 bazillion maps and tiles into RAM, every time you move into a new room load the new room/tile set. The delay that occurs when loading is so minor, nobody'll notice it.

Number 3-
KEEP MAPS CONSISTANT! If you walk from a spaceship onto a desert just cause its cool, your a loser. Plus, if half of a sprite is on one edge of the map draw the other half on the opposite map so it looks whole. Im so sick of seeing this messed up.

Number 4-
There are'nt just 1 or 2 magic commands that do this for you. Keep a map array that holds the index of each tile in it and a tile array that holds image/general data about every tile. So the number 1 in the map array might refer to the tile under "TileData(1)". Also, the map array needs to have layers so you can stack birds, on trees, on grass, ect... You draw tiles starting from the one on the bottom layer and you work your way up.

Number 5 - FOREVER
The list goes on

Good luck! Help you need, give you I can(yoda)!
Good points, but I think its just WAY better to look at how TileX did it... that way would have some pretty screwed up code and it would be really hard to debug for any non-seasoned programmer.
Image
User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm

Post by Zamaster »

What, you think my "map array and tile data index" would be screwed up? I think not!
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Zamaster wrote:What, you think my "map array and tile data index" would be screwed up? I think not!
No, I mean for an un-seasoned prorgammer, the code could get REALLY unorganized, messy, and un-managable and be impossible to use: followed by apathy :wink:
Image
Post Reply