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! / More 2D questions....

Author
Message
Graiskye
19
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 7th Aug 2006 07:40
Okay well as some of you may know Im just learning, or relearning as it were how to program.
I have been working on images in 2D working towards a tilebased map editor. So Ive gotten a lot better in the past few days in my understanding of how to accomplish the task, the code may not be optimum or elegant, but it works.
Now as I understand it the program should read the tile assignments from the data lines in the program, well it dont work. Changing any of the numbers ussually has the effect of changing more than just one tile(note;I'm only using two tiles for simplicity sake).

So if someon can take a look at the code maybe you can see what the problem is. Suggestions are welcome, keep in mind I just started, things that may be obvious to you, arent so to me. Thanks a ton in advance.. Grais

ps: almost forgot, another question I have, why are the maps when they are 5x5 not square ? It seems they are rectangular, but the size is 32x32, Too get it to look square I have to go 6x5, just the way it is I guess ?
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 7th Aug 2006 16:59
Here you go...



I took of the screen set up, because it acts weird on my pc.

Quote: "why are the maps when they are 5x5 not square ? It seems they are rectangular, but the size is 32x32, Too get it to look square I have to go 6x5, just the way it is I guess ?"


That is because its a 6x5 map on the data statements.
Check out how i did the pasting of the map, and you'll see it's quite easy to understand, and that there's no need for that many variables. Oh, and remember that a 32x32 pixels image, is actually a 33x33 image, because of the 0,0 coordinate. Also, i changed in the data statement, 1->2 and 0->1, because no image can be loaded as "0".

Hope it helps, ins ome way... and any doubts, just ask...
Graiskye
19
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 7th Aug 2006 23:28
Thanks Zergei, a lot. One thing, I was aware that the map was 6x5, I was asking why when I try make a 5x5, or 10x10 map with 32x32 tiles it isnt a square image ?
The code you wrote is much more efficient, I am working for the most part off examples I find, the documentation for DBP is awful for a rank begginer I must admit, I guess they think all begginers will use DB classsic, whatever. Anyways like I said I'm using examples I find, that code started off with way more useless variables, as I messed with it and came to understand what was going on I cut out a bunch of useless stuff, now I'll use your example, which works great, and learn how to simplify and streamline this process, so thaanks again.
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 7th Aug 2006 23:54
Glad i could help.
Just one thing, i might misuderstood this, but if your still having that 5x5 map, 32x32tiles = not a square map issue, then post me some code and images of it running, so to have a look at it.
Graiskye
19
Years of Service
User Offline
Joined: 29th Jul 2006
Location:
Posted: 8th Aug 2006 01:44
Hey Z, well I have checked it out, and I think, no Im sure, it is more a matter of 'how it looks', I mean when I use a ruler and actually chk the image it is square, but it just doesnt quite look square, so no worries, it is just a matter of perception. Thx again.

Login to post a reply

Server time is: 2026-07-05 16:51:02
Your offset time is: 2026-07-05 16:51:02