Well I'm nearing the end of Roanoke and this is the very last puzzle. I hope. I am trying to construct a torn note puzzle where you have to put the pieces together. I am using the sliderbars tutorial script.
1. What I want to try to do is. When I move the note piece to it's correct spot I don't want to be able to move it again once it is in place.
2. When all the pieces are in place correctly I want to be able to go into the next room which shows the assembled note when it is put together
3. I can move the first piece of puzzle, no problem, but when I try to drag the second piece, it just moves by itself and stays in the one spot as you can see in the pic below
Ok, here is the script for the start cutscene
Code: Select all
realtime (true)
loadroom (Room2)
setnum (N1x ; 559)
setnum (N1y ; 559)
setnum (N2x ; 345)
setnum (N2y ; 345)
setnum (N3x ; 166)
setnum (N3y ; 166)
setnum (N4x ; 467)
setnum (N4y ; 467)
setnum (N5x ; 283)
setnum (N5y ; 467)
setnum (N6x ; 482)
setnum (N6y ; 467)
setnum (N7x ; 41)
setnum (N7y ; 467)
setnum (N8x ; 187)
setnum (N8y ; 467)
Code: Select all
on (loop1)
if_num (Note_1 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N1x ; +[x])
moveobj (Note_1; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_2 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N2x ; +[x])
moveobj (Note_2 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_3 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N3x ; +[x])
moveobj (Note_3 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_4 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N4x ; +[x])
moveobj (Note_4 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_5 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N5x ; +[x])
moveobj (Note_5 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_6 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N6x ; +[x])
moveobj (Note_6 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_7 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N7x ; +[x])
moveobj (Note_7 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
if_num (Note_8 ; 1)
{
setnum (x ; 0)
setnum (y ; 0)
setnum (x ; [mousex] -[mx])
setnum (y ; [mousey] -[my])
setnum (N8x ; +[x])
moveobj (Note_8 ; +[x] ; +[y]; 0)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
Code: Select all
on (click)
{
setnum (Note_1 ; 1)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
on (release)
{
if_yobj (Note_1 ; <195)
setnum (ypos ; 1)
if_yobj (Note_1 ; >194)
setnum (ypos ; 2)
setnum (xpos ; 0)
setnum (xpos ; [N1x])
setnum (xpos ; [xpos]/152)
if_num (xpos ; <1)
setnum (xpos ; 1)
if_num (xpos ; >4)
setnum (xpos ; 4)
setnum (ok ; 0)
if_num (Note_2x ; [xpos])
if_num (Note_2y ; [ypos])
setnum (ok ; 99)
if_num (Note_3x ; [xpos])
if_num (Note_3y ; [ypos])
setnum (ok ; 99)
if_num (Note_4x ; [xpos])
if_num (Note_4y ; [ypos])
setnum (ok ; 99)
if_num (ok ; 0)
{
setnum (Note_1x ; [xpos])
setnum (Note_1y ; [ypos])
}
if_num (ok ; 99)
playsound (wrong)
if_num (Note_1y ; 1)
setnum (ypos ; 69)
if_num (Note_1y ; 2)
setnum (ypos ; 243)
setnum (N1x ; [Note_1x] * 152 + 4)
moveobj (Note_1 ; [N1x] ; [ypos] ; 0)
setnum (Note_1 ; 0)
}
Code: Select all
on (click)
{
setnum (Note_2 ; 1)
setnum (mx ; [mousex])
setnum (my ; [mousey])
}
on (release)
{
if_yobj (Note_2 ; <195)
setnum (ypos ; 1)
if_yobj (Note_2 ; >194)
setnum (ypos ; 2)
setnum (xpos ; [N2x])
setnum (xpos ; [xpos]/240)
if_num (xpos ; <1)
setnum (xpos ; 1)
if_num (xpos ; >4)
setnum (xpos ; 4)
setnum (ok ; 0)
if_num (Note_4x ; [xpos])
if_num (Note_4y ; [ypos])
setnum (ok ; 99)
if_num (Note_3x ; [xpos])
if_num (Note_3y ; [ypos])
setnum (ok ; 99)
if_num (Note_1x ; [xpos])
if_num (Note_1y ; [ypos])
setnum (ok ; 99)
if_num (ok ; 0)
{
setnum (Note_2x ; [xpos])
setnum (Note_2y ; [ypos])
}
if_num (ok ; 99)
playsound (wrong)
if_num (Note_2y ; 1)
setnum (ypos ; 69)
if_num (Note_2y ; 2)
setnum (ypos ; 243)
setnum (N2x ; [Note_2x] * 240 + 4)
moveobj (Note_2 ; [N2x] ; [ypos] ; 0)
setnum (Note_2 ; 0)
}