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! / Question regarding reading from a data file.

Author
Message
Hoose
20
Years of Service
User Offline
Joined: 15th Feb 2006
Location: Lost in the corners of my Mind!
Posted: 11th Mar 2006 21:30 Edited at: 11th Mar 2006 21:31
I asked this question over in the newcomers area without success. So maybe someone over here can help. As per the forum rules I waited till it expired off of the first page (almost second now). Maybe someone here has an idea, since this is 2D related. Thanks!

Previous thread is here:

http://forum.thegamecreators.com/?m=forum_view&t=73448&b=7

Hoose
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 12th Mar 2006 02:19 Edited at: 12th Mar 2006 02:24
I got it working, as far as i understood what your problem was.
I made a little program in which you control x and y (very similar to athe players x and y position, but these coordinates must actually be used for the upper left tile to be pasted, thats the first tile i mean) so, using the formula within the code should allow you to access the proper byte/data (whatever...). When you reach an x position of 32, the byte thing says 1024, if you reach y on 32, byte goes to 8192, which i think is correct according to your explanation of how the map is done. Of course, it also works if both variables are used at the same time, so x=32 and y=32 would be 9217... try it out, its a very simple program, i doubt you'll have difficulties understanding it, and of course, tell me if it's what you where asking for.

Heres the code... no media:



Hope it helps...
Hoose
20
Years of Service
User Offline
Joined: 15th Feb 2006
Location: Lost in the corners of my Mind!
Posted: 14th Mar 2006 01:41
That's great. I think I can modify that and turn it into a function. It worked a little backwards as I recall when I tried it (actually the file I'm reading from is backwards not your code). Thanks!

Hoose

Login to post a reply

Server time is: 2026-07-02 01:26:32
Your offset time is: 2026-07-02 01:26:32