Code: Select all
if ([coorlistx[movedplace[0]], coorlisty[movedplace[1]]] in piecelist):
python:
t1 = piecelist[movedpiece]
t2 = piecelist.index([coorlistx[movedplace[0]], coorlisty[movedplace[1]]])
piecelist[movedpiece] = [coorlistx[movedplace[0]],coorlisty[movedplace[1]]]
piecelist[t2] = t1
else:
$ piecelist[movedpiece] = [coorlistx[movedplace[0]],coorlisty[movedplace[1]]]
if piecelist == [[coorlistx[0],coorlisty[0]],
[coorlistx[1],coorlisty[0]],
[coorlistx[2],coorlisty[0]],
[coorlistx[3],coorlisty[0]],
[coorlistx[0],coorlisty[1]],
[coorlistx[1],coorlisty[1]],
[coorlistx[2],coorlisty[1]],
[coorlistx[3],coorlisty[1]],
[coorlistx[0],coorlisty[2]],
[coorlistx[1],coorlisty[2]],
[coorlistx[2],coorlisty[2]],
[coorlistx[3],coorlisty[2]]]:
E.g.
Code: Select all
screen bridge:
add "bridgebg"
add "bridge" xalign 0.5
draggroup:
### pieces
drag:
drag_name "oval"
child "oval"
dragged piece_dragged
#draggable True
droppable False
draggable True
xpos 50 ypos 50
drag:
drag_name "triangle"
child "triangle"
dragged piece_dragged
#draggable True
droppable False
draggable True
xpos 20 ypos 400
drag:
drag_name "rectangle"
child "rectangle"
dragged piece_dragged
#draggable True
droppable False
draggable True
xpos 1650 ypos 50
drag:
drag_name "square"
child "square"
dragged piece_dragged
#draggable True
droppable False
draggable True
xpos 50 ypos 600
drag:
drag_name "circle"
child "circle"
dragged piece_dragged
#draggable True
droppable False
draggable True
xpos 1630 ypos 650
### destinations
drag:
drag_name "rect_destination"
child "4rectangle"
draggable False
droppable True
xpos 549 ypos 88
drag:
drag_name "square_destination"
child "4square"
draggable False
droppable True
xpos 830 ypos 100
drag:
drag_name "circle_destination"
child "4circle"
draggable False
droppable True
xpos 830 ypos 350
drag:
drag_name "oval_destination"
child "4oval"
draggable False
droppable True
xpos 1103 ypos 94
drag:
drag_name "triangle_destination"
child "4triangle"
draggable False
droppable True
xpos 1160 ypos 445
Thank you for your time.