public class GridPhysics extends java.lang.Object implements Physics
Modifier and Type | Field and Description |
---|---|
java.awt.Dimension |
gridsize
Size of the grid.
|
Constructor and Description |
---|
GridPhysics()
Default constructor, gridsize will be 10x10
|
GridPhysics(java.awt.Dimension gridsize)
Constructor of the physics, specifying the gridsize
|
Modifier and Type | Method and Description |
---|---|
Types.MOVEMENT |
activeMovement(VGDLSprite sprite,
Direction action,
double speed) |
double |
distance(java.awt.Rectangle r1,
java.awt.Rectangle r2)
Hamming distance between two rectangles.
|
Types.MOVEMENT |
passiveMovement(VGDLSprite sprite) |
public GridPhysics()
public GridPhysics(java.awt.Dimension gridsize)
gridsize
- Size of the grid.public Types.MOVEMENT passiveMovement(VGDLSprite sprite)
passiveMovement
in interface Physics
public Types.MOVEMENT activeMovement(VGDLSprite sprite, Direction action, double speed)
activeMovement
in interface Physics