Remove data tile dependency for water level tile. Not really necessary
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
118ec8aa61
commit
a2d22e4f8e
BIN
maps/world1.map
BIN
maps/world1.map
Binary file not shown.
@ -12,15 +12,7 @@ public class WaterEvent implements Event{
|
||||
|
||||
@Override
|
||||
public boolean performCollision(int x, int y) {
|
||||
char val1=RabiClone.CURRENT_MAP.getMap().getDataTileValue(x/Tile.TILE_WIDTH+1, y/Tile.TILE_HEIGHT);
|
||||
char val2=RabiClone.CURRENT_MAP.getMap().getDataTileValue(x/Tile.TILE_WIDTH, y/Tile.TILE_HEIGHT+1);
|
||||
if (val1!=Character.MAX_VALUE) {
|
||||
RabiClone.CURRENT_MAP.getMap().setWaterLevel(val1);
|
||||
//System.out.println("Water level set to "+(int)RabiClone.CURRENT_MAP.getMap().getWaterLevel());
|
||||
} else {
|
||||
RabiClone.CURRENT_MAP.getMap().setWaterLevel(val2);
|
||||
//System.out.println("Water level set to "+(int)RabiClone.CURRENT_MAP.getMap().getWaterLevel());
|
||||
}
|
||||
RabiClone.CURRENT_MAP.getMap().setWaterLevel((char)(y/Tile.TILE_HEIGHT*Tile.TILE_HEIGHT));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package sig.objects;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.Arrays;
|
||||
|
||||
import sig.RabiClone;
|
||||
import sig.engine.Action;
|
||||
|
Loading…
x
Reference in New Issue
Block a user