how to use the repeat loop
Posted: Fri Feb 01, 2013 2:06 am
hi there, can you help me with these? im having a problem on my player's move regarding on the deduction of move. i have here the code:
the problem is when the player reaches to the last line before finish. when the player subtracts moves three times it will move back to the first line of the grid. how will i use a repeat loop for this so that the player wont move down to the first line? just maintain the move. thanks
Code: Select all
on movePone
put (numdice1+sdice) into sdice
put setofLocations(sdice) into pMoveOneLoc
getTheLocation "plyrOne"
if sdice > 36 then
put (sdice-36) into sdice
put (36-sdice) into sdice
--put (sdice-numdice1) into sdice
put setofLocations(sdice) into pMoveOneLoc
move btn "plyrOne" from theCurrentLocation to pMoveOneLoc in 100 ticks
--answer "ksjdlkf"
else
move btn "plyrOne" from theCurrentLocation to pMoveOneLoc in 100 ticks
end if
put sdice into numdice1
pOneTrap
winnerPlayer
end movePone