The Daily Click ::. Forums ::. Klik Coding Help ::. Switching places
 

Post Reply  Post Oekaki 
 

Posted By Message

Scott Handelman



Registered
  19/05/2004
Points
  117
16th August, 2004 at 01:50:56 -

So, as I said, I'm making a Pipe Dreams-esque type game. I have a 16x12 board consisting of three different types of tiles. I want to ability to right click on a tile and drag it to the location of another tile, drop it, and have that tile and the other tile switch places. I can't seem to do it without some of the tiles moving weird ways or having one action affect all tiles of a certain type. Any pointers?

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
16th August, 2004 at 01:56:23 -

There is an option called "Swap position between objects".

 
a/n

Scott Handelman



Registered
  19/05/2004
Points
  117
16th August, 2004 at 13:01:35 -

I know, but that's not what I'm asking. I want to be able to click on a tile, drag it to the spot of another tile, take my finger off the right mouse button and have the piece I was dragging go where I dragged it to (but aligned correctly), and have the piece I clicked on second go where the first piece originally was.

I mean, your idea would work if I wasn't actually dragging one piece to another place, and if it comes down to it, I might try a different method in which I just click on a piece to highlight it, and then click on another piece to switch its position with the highlighted piece. We'll see.

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
16th August, 2004 at 13:15:21 -

You have to make an object that stores the position where the time has been picked up from (I'll just call it Active Object 1.
When picking a tile up, Active Object 1 is created in the same position as the tile picked up. When releasing the button the tile overlapping switches places with Active object 1, then the dragged object goes to the same position as Active Object 1, then destroy Active Object 1.

 
a/n

Scott Handelman



Registered
  19/05/2004
Points
  117
16th August, 2004 at 13:34:37 -

I tried that before I posted. It didn't work. I think I'm just going to go with highlighting tiles instead of dragging them.

 
n/a

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
16th August, 2004 at 16:37:41 -

Try using the object's alterable value to determine it, that way it'll only affect one of them and not all.

 
http://www.fzgames.com
   

Post Reply



 



Advertisement

Worth A Click