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.

2D All the way! / yet another "tilemaps suck, please help" post... (ok not exactly)

Author
Message
Caldar
20
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 14th Aug 2005 02:58
I'm ready to go nuts.

I've spent 15 hours trying to learn how to make a tilemap with Pizzaman's code.
http://darkbasic.thegamecreators.com/?m=codebase_view&i=0ee878a92195ee8c39c59bc3196e47d1

I took his source and basically rewrote it with half of it ripped out

Why would I do this you might ask? I'm trying to change the resolution!!! argh... 800 x 600 is too low. I want 1024 x 768.

However, just changing the variables I see *LINKED* to the resolution doesn't work. If you just change those few obvious ones, you end up with crashes if you try to "move" downward.

The only thing I can figure is that the x and y of the "paste image" loop are too high and when the numbers get calculated, it runs out of tiles to paste down.

If I change the numbers, I run into other problems. (ahh it gets very messy)

I'm not asking for anyone to code everything for me. I'd just really like some help figuring out what concept I'm missing.

I know the code looks nuts, but if you check the link the original is fairly well remarked by Pizzaman.

Ty in advance
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Aug 2005 03:57 Edited at: 14th Aug 2005 03:57
It didn't work. Post it in code snips.



Maybe the dim statement for the map is too low.
pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 14th Aug 2005 04:33 Edited at: 14th Aug 2005 04:40
Hi

I've now generalised my code so it should work with any resolution and tile sizes. The new code is in the code snippet.



The reason you had difficulty trying to rewrite the code is because it was only designed to run at 800 by 600 only. The code itself is only really meant to teach you how to scroll a tile map, so you can build your own. However, I must appologise as there were one or two bugs in the original code.

I've now amended the codebase entry with my new code so hopefully there will be no problems.

Caldar
20
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 14th Aug 2005 14:44
Sorry about the code-not-posting why do they go through the trouble of giving us the code box if it doesn't work? lmao ...

Ty Pizzaman, I will check it out I managed to find a website with 2000000 tutorials for tilemap engines .. it's all very old and it's for qbasic ... but it seems more understandable than c / c++

And ty for making such a useful tool.
Caldar
20
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 14th Aug 2005 22:44
I'm having another prob ;p lets see if I can actually put this stuff in...

good so far.
OKAY the problem I'm having is that I've added 5 sets of data to the
bottom of the data set. In theory it should lengthen the map by 5.
I changed the one variable that I know has to do with the length of the map. (was 30, now 35)

But (and I found out this happened even with only 30) sometimes when the ship moves across the map, the map stops moving and won't scroll. I'm not sure what's going on.

When I added the 5 extra sets of data, I can move the ship down but then the map will no longer scroll back up.

Any help for a poor newb ;P would be appreciated.


Login to post a reply

Server time is: 2026-07-08 15:14:18
Your offset time is: 2026-07-08 15:14:18