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 level Ed

Author
Message
soapyfish
21
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 15th Apr 2004 01:11
Hey all,
I'm working on a 2d level editor, the type that uses tiles. So far I've got a screen with 3 boxes on the left. A red one a green one and a yellow one, these are meant to be some very simple tiles. I've programmed enough so that you can click on these tiles and drag them anywhere you want n the screen but now I've come to a problem. I want it so that when you click on, say, the yellow square you get a yellow tile to put on the screen but then you can get another one by clicking on the yellow square again. At the moment you can only use each tile once. I had the idea that you could use the
when drawing the sprites and then arrays to store the position but there may be a better way then this, maybe just using copy sprite etc. I've included the source code for you to have a look at.Thanks in advance.

codemonkey 0gamemad0

HEY, YOU THERE, THE ONE READING THIS, WHY NOT VISIT OUR TEAM SITE.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Apr 2004 01:24
You should be able to click on the yellow square and keep pasting it to the screen 1000 times if you want without going back to the yellow square, and clicking on it again. When you paste something to the screen, you store it's coordinates in an array.

Map(x,y)=tileNumber

Scrolling the map is your main problem. You can open a huge long screen. Or control the tiles manually.

soapyfish
21
Years of Service
User Offline
Joined: 24th Oct 2003
Location: Yorkshire, England
Posted: 15th Apr 2004 01:32 Edited at: 15th Apr 2004 01:43
I think I get what you mean. Are you saying that I'd be ok using the for...next loop.

Edit: Thanks for your help but another member of the team (code monkey michael eddie) has sloved the problem. What are teams for, to show you how bad you are at coding thats what. Thanks again.

code monkey 0gamemad0

HEY, YOU THERE, THE ONE READING THIS, WHY NOT VISIT OUR TEAM SITE.
Blue Shadow
21
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 15th Apr 2004 01:56 Edited at: 15th Apr 2004 01:58
Yeah. What he had was that you dragged the tiles from the left. I just did it so that you clicked on the tiles and it set the image number to that colour. So i put this:



Depending on what tile you clicked on changed the tilenum which was the variable for the image number. If you see what i mean.

Anyway that cleared things up. I'm going to go and have a nice cup of tea and then go to bed.

Goodnight............... slrrp............ZZZZZZZZZZzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz


Visit the Code Monkey's website at http://www.freewebs.com/codemonkeystudios

Login to post a reply

Server time is: 2025-08-09 02:12:53
Your offset time is: 2025-08-09 02:12:53