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 |
|---|---|
void |
activeMovement(VGDLSprite sprite,
Vector2d action,
double speed) |
double |
distance(java.awt.Rectangle r1,
java.awt.Rectangle r2)
Hamming distance between two rectangles.
|
void |
passiveMovement(VGDLSprite sprite) |
public GridPhysics()
public GridPhysics(java.awt.Dimension gridsize)
gridsize - Size of the grid.public void passiveMovement(VGDLSprite sprite)
passiveMovement in interface Physicspublic void activeMovement(VGDLSprite sprite, Vector2d action, double speed)
activeMovement in interface Physics