how to use the repeat loop

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kesh17aki
Posts: 12
Joined: Sat Jan 19, 2013 4:05 am

how to use the repeat loop

Post by kesh17aki » 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:

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
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

Post Reply

Return to “Games”