Reworked the directories to be a little more machine independent and make the hero snap to grid cells when moving, which improved collision handling.

This commit is contained in:
dalyjame
2019-08-06 20:49:31 -04:00
parent 0071e5af80
commit 2fc918a728
9 changed files with 149 additions and 30 deletions

View File

@@ -1,7 +1,18 @@
package fmon.util
object Direction extends Enumeration {
val North, Northeast, East, Southeast, South, Southwest, West, Northwest = Value
case class Val protected(x: Int = 0, y: Int = 0) extends super.Val {
}
val Stationary = Val()
val North = Val(y = -1)
val Northeast = Val(x = 1, y = -1)
val East = Val(x = 1)
val Southeast = Val(x = 1, y = 1)
val South = Val(y = 1)
val Southwest = Val(x = -1, y = 1)
val West = Val(x = -1)
val Northwest = Val(x = -1, y = -1)
val cardinals = Set(North, East, South, West)
}