MCPcopy Create free account
hub / github.com/SimHacker/micropolis / getDis

Method getDis

micropolis-java/src/micropolisj/engine/Sprite.java:121–124  ·  view source on GitHub ↗

Computes manhatten distance between two points.

(int x0, int y0, int x1, int y1)

Source from the content-addressed store, hash-verified

119 * Computes manhatten distance between two points.
120 */
121 static final int getDis(int x0, int y0, int x1, int y1)
122 {
123 return Math.abs(x0-x1) + Math.abs(y0-y1);
124 }
125
126 /**
127 * Replaces this sprite with an exploding sprite.

Callers 4

checkSpriteCollisionMethod · 0.95
moveImplMethod · 0.80
moveImplMethod · 0.80
moveImplMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected