comparison game/Piece.java @ 37:3dc5ae9f1c80

Work on game logic.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 18 Feb 2011 04:58:30 +0200
parents 6f6c551cc14c
children e682b623aea9
comparison
equal deleted inserted replaced
36:a43587e14485 37:3dc5ae9f1c80
84 type = ptype; 84 type = ptype;
85 } 85 }
86 86
87 public int getConnection(int in) 87 public int getConnection(int in)
88 { 88 {
89 return connections[(in + (currRotation * 2)) % 8]; 89 int offs = (in + (currRotation * 2)) % 8;
90 if (offs < 0)
91 offs = 8 + offs;
92
93 return connections[offs];
90 } 94 }
91 95
92 public void rotate(RotateDir dir) 96 public void rotate(RotateDir dir)
93 { 97 {
94 // Only normal 98 // Only normal