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.

DarkBASIC Professional Discussion / 2D tiles are incorrect

Author
Message
Darth Sidious 666
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location:
Posted: 31st Oct 2012 13:12
I am using Phaelax's loadTileMap function to load a tileset (which works a treat.

The problem I have is that if I read data from these statements which is supposed to be the tile's image:

//map data
data 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 191, 27, 216, 30, 200, 1, 1, 1, 1, 1, 1, 141, 144, 129, 130, 212, 213, 202, 164, 165, 162, 194, 5, 85, 68, 67, 44, 68, 65, 23, 23, 22, 21, 70, 70, 66, 67, 41, 84, 68, 67, 68, 69
data 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 167, 174, 170, 175, 180, 1, 1, 1, 1, 1, 1, 1, 1, 160, 233, 234, 214, 210, 167, 195, 25, 105, 88, 87, 103, 88, 84, 91, 252, 253, 254, 255, 256, 42, 86, 103, 104, 88, 87, 86, 85
data 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 159, 143, 180, 1, 1, 1, 1, 1, 141, 168, 171, 175, 353, 354, 193, 191, 179, 215, 45, 128, 108, 107, 123, 108, 105, 271, 272, 273, 274, 275, 276, 62, 107, 123, 124, 108, 107, 108, 105
data 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 185, 186, 171, 169, 175, 200, 180, 1, 1, 192, 167, 162, 191, 170, 169, 189, 165, 159, 71, 23, 22, 21, 70, 66, 67, 81, 291, 292, 293, 294, 295, 296, 82, 41, 68, 69, 76, 78, 24, 128

The tile displayed is the last in the sequence and all the tiles are the same when the data statements are clearly different!

BTW: This is only 4 lines of the map, I still need to finish it

Can anyone help with some code examples? I've had a look at side scrolling tutorials but this map is more akin to Chaos Engine style maps rather than say Castlevania.

Big thanks!

Your skills are no match for the Power of DarkBASIC Pro!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Oct 2012 23:52
Got a link to my function you're using? Your map data might not be formatted correctly

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Darth Sidious 666
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location:
Posted: 1st Nov 2012 16:01 Edited at: 1st Nov 2012 16:05
Hi Phaelax,

You were right about the map data not being formatted properly, I had the X value being read first rather than the Y

Phaelax's function:


Now I've found another headache, here's what I mean:



my makeWorld function:

My function has a rather large select -> case statement. Which for 381 tiles isn't fun to write out.

Is there a better way of doing this? (please give code examples) I've tried using for-next but that just gives me a load of trees or crashes completely.

I guess a tweak or so to Phaelax's function might be the answer but I get lost with some of the maths.

Thanks in advance.

Your skills are no match for the Power of DarkBASIC Pro!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Nov 2012 16:05


Does the same as your above code.

TheComet

- The codebase
Darth Sidious 666
20
Years of Service
User Offline
Joined: 14th Dec 2005
Location:
Posted: 1st Nov 2012 16:07
OH!

Wonderful! Thank you TheComet. I must be having a wood -> trees moment.

Don't suppose you know how to do diagonals on a keyboard do you?

Thank you.

Your skills are no match for the Power of DarkBASIC Pro!

Login to post a reply

Server time is: 2026-07-11 06:04:06
Your offset time is: 2026-07-11 06:04:06