Ok, I hope i translate this right..if not let me know..The hotspot coordinates would be according to your project, you would change these as u wanted..
This puzzle is designed so u can put a picture together, all square pieces. It would look somewhat like a slider. Only you click one picture, then another, and they exchange places. This puzzle is similar to what u see in most Nancy Drew games..MCF games..ect..
This is for 6 pieces, anymore and u would have to add to the subroutines.
Variables needed;
piece1selected
piece2selected
change1
change2
In the Advanced tab of each puzzle piece. Call the subroutine piece_selecting
You need 3 Sub Routines
- Code: Select all
Sub change_pictures
ypos1 = Hotspot(change1).Top/15
xpos1 = Hotspot(change1).Left/15
ypos2 = Hotspot(change2).top/15
xpos2 = Hotspot(change2).left/15
Hotspot(change1).Move xpos2*15,ypos2*15
Hotspot(change2).Move xpos1*15,ypos1*15
change1=0
change2=0
piece1selected=0
piece2selected=0
check_pieces
End Sub
- Code: Select all
sub piece_selecting
If piece1selected=0 Then
piece1selected=1
change1=GetHotspotNumber
ElseIf piece1selected=1 Then
piece2selected=1
change2=GetHotspotNumber
change_pictures
End If
End Sub
- Code: Select all
sub check_pieces
check_hs1x = Hotspot(1).Left/15
check_hs1y = Hotspot(1).Top/15
check_hs2x = Hotspot(2).Left/15
check_hs2y = Hotspot(2).Top/15
check_hs3x = Hotspot(3).Left/15
check_hs3y = Hotspot(3).Top/15
check_hs4x = Hotspot(4).Left/15
check_hs4y = Hotspot(4).Top/15
check_hs5x = Hotspot(5).Left/15
check_hs5y = Hotspot(5).Top/15
check_hs6x = Hotspot(6).Left/15
check_hs6y = Hotspot(6).Top/15
If check_hs1x=342 and check_hs1y=308 Then
piece1=1
Else
piece1=0
End If
If check_hs2x=444 and check_hs2y=308 Then
piece2=1
Else
piece2=0
End If
If check_hs3x=546 and check_hs3y=308 Then
piece3=1
Else
piece3=0
End If
If check_hs4x=342 and check_hs4y=409 Then
piece4=1
Else
piece4=0
End If
If check_hs5x=443 and check_hs5y=409 Then
piece5=1
Else
piece5=0
End If
If check_hs6x=546 and check_hs6y=409 Then
piece6=1
Else
piece6=0
End If
If piece1=1 and piece2=1 and piece3=1 and piece4=1 and piece5=1 and piece6=1 Then
GoToFrame"ticket_solved"
End If
End Sub
I hope I didn't miss anything..Please let me know..and again Thanks Juhu!~
