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! / 2D tile help

Author
Message
The Terminator
20
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 30th Aug 2003 09:02
Hey guys I know I'm doing something wrong here but i just don't know what ...
I'm trying to make a tile engine but I forget how to
paste the tiles I know you have to do something like this

DIM MAP01 (5, 5)

FOR X = 1 TO 5
FOR Y = 1 TO 5
READ MAP01
NEXT Y
NEXT X

MAP01:
DATA 01,01,01,01,01
DATA 01,00,00,00,01
DATA 01,00,00,00,01
DATA 01,00,00,00,01
DATA 01,01,01,01,01

IF MAP01 = 1 THEN PASTE IMAGE 20, X, Y

Now the problem is that it gives me an error, it tells me the syntax for paste is worng can anyone tel me why this is happening?

Windows! The game that never ends.
The Terminator
20
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 30th Aug 2003 10:11
I have a question why did the creators of the wonderful software take out 3 of the best commands and basic history? they are GET, PUT and PSET without these commands it's alot harder to code something as a tile engine.

Windows! The game that never ends.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 30th Aug 2003 11:31
i don't know about those commands but heres an example of loading tiles


i've commented it but if you don't understand just ask


The Terminator
20
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 30th Aug 2003 11:57
Thanks Red_Eye but thats the easy part I ment in a loop with then sync command set to manual when that happens the tiles will not
show and i donno why



SYNC ON : SYNCRATE 0
DIM MAP(11,9)


DATA 01,01,01,01,01
DATA 01,01,01,01,01
DATA 01,01,01,01,01
DATA 01,01,01,01,01
DATA 01,01,01,01,01

DIM MAP(11,9)
DO

FOR X = 7 TO 11
FOR Y = 5 TO 9
READ MAP
IF MAP = 01 THEN PASTE IMAGE 20, X * 64 - 1, Y * 64 - 1
NEXT Y
NEXT X
SYNC
LOOP

Windows! The game that never ends.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 30th Aug 2003 16:51
You are trying to read you data in the main loop.

Before you get to the main loop you need to read the data into the map array.

also your map array is map(11,9) which is 0 to 10 and 0 to 8, your trying to access x = 11 and y = 9 which don't exist.

I didn't test this but it should work.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 30th Aug 2003 16:56
also if you use all integer numbers 1,2,3,4,5 ect... for your map arrays.
load all of your image with those numbers image 1,image 2....so on.

then you don't need any if statement for your drawing map routine just do it like this,

paste image map(x,y),screenx,screeny

it makes it so much easier, and cleaner.
The Terminator
20
Years of Service
User Offline
Joined: 19th Aug 2003
Location:
Posted: 30th Aug 2003 19:42
Thanks CloseToPerfect but I found out why my tiles where not showing up, I was trying to load them on top of another image the problem with this is that background image would always overwrite the tile
so I removed the image and cut it up into tiles then tiled it on the screen and now it doesn't do that anymore.

Windows! The game that never ends.

Login to post a reply

Server time is: 2024-03-28 17:28:32
Your offset time is: 2024-03-28 17:28:32