Skip to content

Commit 8d548f5

Browse files
undid change to water splash radius
1 parent 803468f commit 8d548f5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/client/java/minicraft/item/WateringCanItem.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import minicraft.gfx.Point;
88
import minicraft.gfx.SpriteLinker;
99
import minicraft.level.Level;
10+
import minicraft.level.tile.FlowerTile;
1011
import minicraft.level.tile.DirtTile;
1112
import minicraft.level.tile.GrassTile;
1213
import minicraft.level.tile.Tile;
@@ -56,15 +57,13 @@ public boolean interactOn(Tile tile, Level level, int xt, int yt, Player player,
5657
renderingTick++;
5758
Random random = new Random();
5859
if (renderingTick >= 8) {
59-
int px = player.x + 16 * attackDir.getX();
60-
int py = player.y + 16 * attackDir.getY();
61-
6260
for (int i = 0; i < 4; i++) {
6361
SpriteLinker.LinkedSprite splash = spriteSplash[random.nextInt(spriteSplash.length)];
64-
int x = px + random.nextInt(5) - 2;
65-
int y = py + random.nextInt(5) - 2;
66-
int destX = px + random.nextInt(3) - 1;
67-
int destY = py + random.nextInt(3) - 1;
62+
// 2-pixel deviation for centering particle sprites.
63+
int destX = player.x - 2 + 12 * attackDir.getX() + random.nextInt(9) - 4;
64+
int destY = player.y - 2 + 12 * attackDir.getY() + random.nextInt(9) - 4;
65+
int x = player.x - 2 + 4 * attackDir.getX() + random.nextInt(5) - 2;
66+
int y = player.y - 2 + 4 * attackDir.getY() + random.nextInt(5) - 2;
6867
level.add(new WaterParticle(x, y, 80 + random.nextInt(61) - 30, splash, destX, destY));
6968
}
7069
renderingTick = 0;

0 commit comments

Comments
 (0)