From 7cce41e650cfdb83869060618f56f2ade58ff0cb Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 8 Apr 2015 08:57:07 -0400 Subject: [PATCH] v0.3.0: adjusted dist1 neighbours arrays such that for any given index i, i-1 and i+1 correspond to the adjacent neighbour tiles. --- .../shatteredpixeldungeon/levels/Level.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index a9b9e3c58..2eacdb39b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -91,15 +91,15 @@ public abstract class Level implements Bundlable { WATER, GRASS, DARK - }; + } public static final int WIDTH = 32; public static final int HEIGHT = 32; public static final int LENGTH = WIDTH * HEIGHT; - public static final int[] NEIGHBOURS4 = {-WIDTH, +1, +WIDTH, -1}; - public static final int[] NEIGHBOURS8 = {+1, -1, +WIDTH, -WIDTH, +1+WIDTH, +1-WIDTH, -1+WIDTH, -1-WIDTH}; - public static final int[] NEIGHBOURS9 = {0, +1, -1, +WIDTH, -WIDTH, +1+WIDTH, +1-WIDTH, -1+WIDTH, -1-WIDTH}; + public static final int[] NEIGHBOURS4 = {-WIDTH, +1, +WIDTH, -1}; + public static final int[] NEIGHBOURS8 = {-WIDTH, +1-WIDTH, +1, +1+WIDTH, +WIDTH, -1+WIDTH, -1, -1-WIDTH}; + public static final int[] NEIGHBOURS9 = {0, -WIDTH, +1-WIDTH, +1, +1+WIDTH, +WIDTH, -1+WIDTH, -1, -1-WIDTH}; //make sure to check insideMap() when using these, as there's a risk something may be outside the map public static final int[] NEIGHBOURS8DIST2 = {+2+2*WIDTH, +1+2*WIDTH, 2*WIDTH, -1+2*WIDTH, -2+2*WIDTH,