Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Tile Based Engine Frustration

Author
Message
CrayZemon
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 19th Jun 2003 01:41
I am currently in the process of developing a tile-map engine with the trial version of Dark Basic. I will be ordering the full version, but in the mean time...
My code is frustrating me. I have all the media files in their respective places (the same directory: is that so hard DB!). It reads the map.txt and my bitmaps and only displays my ship hovering across the black screen instead of the tiles that I meticulously designed. Sometimes I even dsignate it a bitmap that I know has been extracted but the tiles prevail in their voidness.

Here is the entire code minus the loading of the bitmaps and the engine used to control the craft:


Any help or comments greatly appreciated. This is my third project to learn the ways of Dark Basic. Oh, and yes, the map.txt file does go something like this:

4544454445442111
4544454445442111
4544454445447333
ect. ect.
"I need gopher-chucks!!"
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Jun 2003 02:18
In your main display loop you have a line:

LEVEL_MAP(mx,my)=todo

Should this not be:

todo=LEVEL_MAP(mx,my)
CrayZemon
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 19th Jun 2003 06:03
Doh <smashes forehead with palm> must have been too much nuron displacement at 11:00pm. Anyway, thanks a ton, the change removed the annoying error message that stated I need to set images between 1 and 6,577. However, I still need something to appear on the screen other than the starfighter (which sprite declaration I didn't include in the code snippet). I'm looking into it and will probably be up till almost midnight again - but hey, it's a tile engine.

"I need gopher-chucks!!"
CrayZemon
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 19th Jun 2003 07:50
Dagnabit!!!
Well, I fixed one bug and it had to do something with the fact that the ASCII value of the number in map.txt was being copied instead of the decimal number. I fixed it like this:



However, the main game loop still proceeds in returning nothing, even with the graphics where they belong and this statement:



I know I have the images loaded because I tried loading sprites of the tile images (ie images 16-22) and they display. However, when I go to overkill and even tell the for loops above to display sprites instead of images it does nothing even though loading individual tiles works outside the loops. What the heck is going on, could someone please help?

I have included the entire source code for the project so far below.

"I need gopher-chucks!!"
CrayZemon
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 19th Jun 2003 08:02
PHEEW!
I fixed it. It was a mistake in the image_start variable that controled what number the tile images started on. It was set a bit too far from some math mistakes I made when I was really tired.
Sorry to trouble you all. Thanks for the help.

"I need gopher-chucks!!"

Login to post a reply

Server time is: 2024-09-20 11:29:39
Your offset time is: 2024-09-20 11:29:39