From 3a23fd23ea104e3963fe6c5a20631798bb384784 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 29 May 2022 00:20:09 -0500 Subject: [PATCH] Include transparent overlay selection tile Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- src/sig/engine/Object.java | 3 +++ src/sig/map/Tile.java | 1 + src/sig/objects/LevelRenderer.java | 6 +++--- tiles.png | Bin 543 -> 5877 bytes 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sig/engine/Object.java b/src/sig/engine/Object.java index 1a46f6b..ec6b286 100644 --- a/src/sig/engine/Object.java +++ b/src/sig/engine/Object.java @@ -47,6 +47,9 @@ public abstract class Object implements GameEntity{ this.spr = spr; } + public void drawOverlay(int[] p) { + } + protected void Draw_Sprite(double x, double y, Sprite sprite){ DrawLoop.Draw_Sprite(x,y,sprite); } diff --git a/src/sig/map/Tile.java b/src/sig/map/Tile.java index 35ff1e1..761f127 100644 --- a/src/sig/map/Tile.java +++ b/src/sig/map/Tile.java @@ -6,6 +6,7 @@ public enum Tile { FLOOR(1,0), PLATFORM_LEDGE(2,0), INVISIBLE_WALL(0,0,true), + HIGHLIGHTED_TILE(3,0), ; final public static int TILE_WIDTH=32; diff --git a/src/sig/objects/LevelRenderer.java b/src/sig/objects/LevelRenderer.java index abf5287..fc1106a 100644 --- a/src/sig/objects/LevelRenderer.java +++ b/src/sig/objects/LevelRenderer.java @@ -32,13 +32,13 @@ public class LevelRenderer extends Object{ public void draw(int[] p) { for (int y=(int)(0+this.getY()/Tile.TILE_HEIGHT);y<(int)(RabiClone.BASE_HEIGHT/Tile.TILE_HEIGHT+this.getY()/Tile.TILE_HEIGHT+1);y++) { for (int x=(int)(0+this.getX()/Tile.TILE_WIDTH);x<(int)(RabiClone.BASE_WIDTH/Tile.TILE_WIDTH+this.getX()/Tile.TILE_WIDTH+1);x++) { - if (x==RabiClone.p.highlightedSquare.getX()&&y==RabiClone.p.highlightedSquare.getY()) { - DrawTile(x*Tile.TILE_WIDTH-this.getX(),y*Tile.TILE_HEIGHT-this.getY(),Tile.WALL); - } if (RabiClone.CURRENT_MAP.getTile(x,y)!=Tile.VOID) { DrawTile(x*Tile.TILE_WIDTH-this.getX(),y*Tile.TILE_HEIGHT-this.getY(),RabiClone.CURRENT_MAP.getTile(x,y)); //System.out.println((x*Tile.TILE_WIDTH+(this.getX()%Tile.TILE_WIDTH) )+","+(y*Tile.TILE_HEIGHT+(this.getY()%Tile.TILE_HEIGHT))); } + if (x==RabiClone.p.highlightedSquare.getX()&&y==RabiClone.p.highlightedSquare.getY()) { + DrawTile(x*Tile.TILE_WIDTH-this.getX(),y*Tile.TILE_HEIGHT-this.getY(),Tile.HIGHLIGHTED_TILE); + } } } } diff --git a/tiles.png b/tiles.png index df8cd15dea2955c875944c8b3e4bba890b76f47b..c2dc26b08dd4dc812596f230590dcd3cb6275031 100644 GIT binary patch literal 5877 zcmeHLXH-+!7QTppf+!9sh&YCb6g52|BoskH3DO2p5Kz2HE+Ld8q!5aYA}TT#nh!() z$A*+aQBV=Vf($5KibRS6DgrVpDgw&8!M@(Cx0Y+Y_s^Sk+c|rGd+%@WbIv{4>*{Q$ zs;sRH0Dvmpp5_MMcgoILitzQO1$YMl6lx;eJwe!DbD(d1-CYugVO-h@~ z`TY*d7c_2&%vUOCT3a9IY+7)q&R|LZ)?;nG3qEXL$T}f)MB(+ZDXr6|qjGVh zeYx4;tXwBdxAaSm&9u z^Get52%Y{Ru&ZL>Iq_P4{;%e+?+!{gd#~ z>o$l4$Fd9+7Y9BM7yRwqmG znt#9@LG4gqIhG>asY;H%9LCVr(k-`2QSYgGzg^+aIf~0&_iGFQp+5R?4XYh03>p*m zM!%`CY7#F7XzgA-b8uQf;H@<&b89#51z7S{ifx3$W);BRJ_Q3ISkR-G7Mp*LHjt6N zoM{5;FckG;SFXG?5QNCpu$uJe?9o+EMIzU`r;Eza?ctM2mJ2M zX$oj=_2RV(*?Ufnc3dp!DqZx3=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