Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Java logic.
#4
I think you should put it right between update and positionupdate. I think loop could also be like this.

Also, delete position += diceroll line; position will be added within the loop.

Code:
boolean reach = false;
while(diceroll > 0)
   if(position == 32)
      reach = true;
   if(reach)
      position--;
   else
      position++;
   diceroll--;

That's the case you may need to animate the movement, but if you don't just use this

Code:
position += diceroll;
if(position > 32)
    position = 64 - position;
Reply


Messages In This Thread
Java logic. - by DeanNim - 2012-08-02, 07:12 AM
Java logic. - by Fiel - 2012-08-02, 07:24 AM
Java logic. - by DeanNim - 2012-08-03, 03:25 AM
Java logic. - by Unauthorized Intruder - 2012-08-03, 12:53 PM
Java logic. - by DeanNim - 2012-08-03, 09:43 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)