Skip to content
Browse files

Add a getOffset() to the grid.

  • Loading branch information...
1 parent eaad2fb commit 0b8f4aafd0c5b7cf5ca1ded921da71bcc88814e7 @gwu committed
View
2 src/main/java/com/garrettwu/blocklink/engine/BlockLinkGameModel.java
@@ -67,7 +67,7 @@ public void update(BlockLinkGameEnvironment environment) {
mLastFrameTime = currentTime;
if (isStarted()) {
- final double speedInBlocksPerSecond = 0.2;
+ final double speedInBlocksPerSecond = 0.1;
mGrid.move(speedInBlocksPerSecond * ((double) timeElapsed / 1000.0));
}
}
View
9 src/main/java/com/garrettwu/blocklink/model/BLGrid.java
@@ -80,6 +80,15 @@ public double getDistance() {
}
/**
+ * Gets the offset from the integer distance traveled.
+ *
+ * @return The floating point component of the distance.
+ */
+ public double getOffset() {
+ return mDistance - Math.floor(mDistance);
+ }
+
+ /**
* Move the block grid "up" by some number of block units.
*
* @param The distance to move the block grid.

0 comments on commit 0b8f4aa

Please sign in to comment.
Something went wrong with that request. Please try again.