Carcassonne

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Carcassonne

Post by richmond62 » Mon Nov 23, 2015 10:05 pm

I am playing around with tiling games, mainly as I use Carcassonne extensively as a teaching aid in my ESL school.

I have got to the, admittedly fairly primitive stage, of making a set of tiles, each capable of being dragged and dropped onto
a grid consisting of drop-targets made up of rectangular graphics.

Each of these tiles also "owns" a button in its centre that allows it to be rotated.
tileBtn.png
tileBtn.png (1.83 KiB) Viewed 5056 times
HOWEVER I have 2 main problems:

1. How do I make sure that once one of my tiles is 'occupying' a drop target no other tiles can be dropped on it?

2. How do I make sure that a tile can be dropped on a target ONLY when its sides match the sides of adjacent tiles?

I'm attaching my goofy stack here.
Attachments
MuckinAround.zip
(2.52 KiB) Downloaded 349 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Carcassonne

Post by richmond62 » Tue Nov 24, 2015 12:30 am

I have just worked out how to set codes so one can identify the characteristics of the sides of a tile.
customProps.png
customProps.png (9.77 KiB) Viewed 5031 times
When one clicks on the central button this rotates the tile and sets 4 customProperties of the image:

T,L,B,R {standing for 'top', 'left', 'right' and 'bottom' respectively]

This means that, regardless of the rotation of the image, one can always determine the colour of the side of the tile
and its location.

The button contains this code:

on mouseDown
put the B of img "t1" into fld "B"
put the L of img "t1" into fld "L"
put the R of img "t1" into fld "R"
put the T of img "t1" into fld "T"
end mouseDown

on mouseUp
put the B of img "t1" into RR
put the L of img "t1" into BB
put the R of img "t1" into TT
put the T of img "t1" into LL
set the angle of img "t1" to ((the angle of img "t1") + 90)
set the L of img "t1" to LL
set the R of img "t1" to RR
set the T of img "t1" to TT
set the B of img "t1" to BB
put the B of img "t1" into fld "B"
put the L of img "t1" into fld "L"
put the R of img "t1" into fld "R"
put the T of img "t1" into fld "T"
end mouseUp

The fields are, obviously, not required, they are here only for demonstration purposes.
Attachments
Proppps.zip
(2.42 KiB) Downloaded 329 times
Last edited by richmond62 on Tue Nov 24, 2015 7:15 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Carcassonne

Post by richmond62 » Tue Nov 24, 2015 12:43 am

Before anyone asks why I am messing around with this, and the thing about
customProperties for sides of cards have a look at the following image:
DSC00617.JPG
https://en.wikipedia.org/wiki/Carcasson ... rd_game%29

Post Reply

Return to “Games”