removed test screens; reorg, added "Passage" tile, WorldGen tweaks
This commit is contained in:
@@ -9,8 +9,8 @@ import javax.swing.JOptionPane;
|
||||
|
||||
import mightypork.gamecore.eventbus.EventBus;
|
||||
import mightypork.gamecore.eventbus.events.DestroyEvent;
|
||||
import mightypork.gamecore.gui.screens.CrossfadeOverlay;
|
||||
import mightypork.gamecore.gui.screens.ScreenRegistry;
|
||||
import mightypork.gamecore.gui.screens.impl.CrossfadeOverlay;
|
||||
import mightypork.gamecore.input.InputSystem;
|
||||
import mightypork.gamecore.logging.Log;
|
||||
import mightypork.gamecore.logging.SlickLogRedirector;
|
||||
|
||||
@@ -31,13 +31,6 @@ public abstract class VisualComponent extends AbstractRectCache implements Compo
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Rect getRect()
|
||||
{
|
||||
return super.getRect();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void setRect(RectBound rect)
|
||||
{
|
||||
@@ -62,7 +55,7 @@ public abstract class VisualComponent extends AbstractRectCache implements Compo
|
||||
@Override
|
||||
public final Rect getCacheSource()
|
||||
{
|
||||
return source;
|
||||
return source.round(); // round to avoid visual artifacts in fonts and such
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TextPainter extends VisualComponent {
|
||||
private boolean shadow;
|
||||
|
||||
private Color shadowColor = Color.BLACK;
|
||||
private Vect shadowOffset = Vect.make(1, 1);
|
||||
private Vect shadowOffset = Vect.make(2, 2);
|
||||
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,10 @@ public class TextPainter extends VisualComponent {
|
||||
final Rect rect = getRect();
|
||||
|
||||
if (shadow) {
|
||||
font.draw(str, rect.move(shadowOffset), align, shadowColor);
|
||||
font.draw(str, rect.round(), align, shadowColor);
|
||||
}
|
||||
font.draw(str, rect, align, color);
|
||||
|
||||
font.draw(str, rect.move(shadowOffset.neg()).round(), align, color);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package mightypork.gamecore.gui.events;
|
||||
|
||||
|
||||
import mightypork.gamecore.eventbus.BusEvent;
|
||||
import mightypork.gamecore.gui.screens.impl.CrossfadeOverlay;
|
||||
|
||||
|
||||
/**
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class CrossfadeRequest extends BusEvent<CrossfadeOverlay> {
|
||||
|
||||
private final String screen;
|
||||
private final boolean fromDark;
|
||||
|
||||
/**
|
||||
* @param screen screen key to show. Null = exit the app.
|
||||
* @param fromDark true to fade from full black (ie. start of the game)
|
||||
*/
|
||||
public CrossfadeRequest(String screen, boolean fromDark)
|
||||
{
|
||||
super();
|
||||
this.screen = screen;
|
||||
this.fromDark = fromDark;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param screen screen key to show. Null = exit the app.
|
||||
*/
|
||||
public CrossfadeRequest(String screen)
|
||||
{
|
||||
super();
|
||||
this.screen = screen;
|
||||
this.fromDark = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleBy(CrossfadeOverlay handler)
|
||||
{
|
||||
handler.goToScreen(screen, fromDark);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package mightypork.gamecore.gui.screens;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.app.AppSubModule;
|
||||
import mightypork.gamecore.gui.events.LayoutChangeEvent;
|
||||
import mightypork.gamecore.gui.events.LayoutChangeListener;
|
||||
import mightypork.gamecore.input.KeyBinder;
|
||||
import mightypork.gamecore.input.KeyBindingPool;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.render.Render;
|
||||
import mightypork.gamecore.util.annot.DefaultImpl;
|
||||
import mightypork.gamecore.util.math.constraints.rect.Rect;
|
||||
|
||||
|
||||
/**
|
||||
* Screen class.
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public abstract class BaseScreen extends AppSubModule implements Screen, KeyBinder, LayoutChangeListener {
|
||||
|
||||
private final KeyBindingPool keybindings = new KeyBindingPool();
|
||||
|
||||
private volatile boolean active;
|
||||
private volatile boolean needSetupViewport = false;
|
||||
|
||||
|
||||
/**
|
||||
* @param app app access
|
||||
*/
|
||||
public BaseScreen(AppAccess app)
|
||||
{
|
||||
super(app);
|
||||
|
||||
// disable events initially
|
||||
setListening(false);
|
||||
|
||||
addChildClient(keybindings);
|
||||
}
|
||||
|
||||
|
||||
private void fireLayoutChangeEvent()
|
||||
{
|
||||
getEventBus().sendDirectToChildren(this, new LayoutChangeEvent());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void bindKey(KeyStroke stroke, Runnable task)
|
||||
{
|
||||
keybindings.bindKey(stroke, task);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void unbindKey(KeyStroke stroke)
|
||||
{
|
||||
keybindings.unbindKey(stroke);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare for being shown
|
||||
*
|
||||
* @param shown true to show, false to hide
|
||||
*/
|
||||
@Override
|
||||
public final void setActive(boolean shown)
|
||||
{
|
||||
if (shown) {
|
||||
active = true;
|
||||
needSetupViewport = true;
|
||||
|
||||
fireLayoutChangeEvent();
|
||||
onScreenEnter();
|
||||
|
||||
// enable events
|
||||
setListening(true);
|
||||
|
||||
} else {
|
||||
onScreenLeave();
|
||||
|
||||
active = false;
|
||||
|
||||
// disable events
|
||||
setListening(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return true if screen is the current screen
|
||||
*/
|
||||
@Override
|
||||
public final boolean isActive()
|
||||
{
|
||||
return active;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLayoutChanged()
|
||||
{
|
||||
if (!isActive()) return;
|
||||
|
||||
needSetupViewport = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Rect getRect()
|
||||
{
|
||||
return getDisplay().getRect();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render()
|
||||
{
|
||||
if (!isActive()) return;
|
||||
|
||||
if (needSetupViewport) {
|
||||
Render.setupOrtho(getDisplay().getSize());
|
||||
}
|
||||
|
||||
Render.pushState();
|
||||
|
||||
renderScreen();
|
||||
|
||||
Render.popState();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the screen becomes active
|
||||
*/
|
||||
@DefaultImpl
|
||||
protected void onScreenEnter()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the screen is no longer active
|
||||
*/
|
||||
@DefaultImpl
|
||||
protected void onScreenLeave()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render screen contents (context is ready for 2D rendering)
|
||||
*/
|
||||
protected abstract void renderScreen();
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package mightypork.gamecore.gui.screens;
|
||||
|
||||
|
||||
import mightypork.gamecore.eventbus.BusEvent;
|
||||
|
||||
|
||||
/**
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class CrossfadeRequest extends BusEvent<CrossfadeRequest.Listener> {
|
||||
|
||||
private final String screen;
|
||||
|
||||
|
||||
/**
|
||||
* @param screen screen key to show. Null = exit the app.
|
||||
*/
|
||||
public CrossfadeRequest(String screen)
|
||||
{
|
||||
super();
|
||||
this.screen = screen;
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
|
||||
void goToScreen(String screen);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleBy(Listener handler)
|
||||
{
|
||||
handler.goToScreen(screen);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import mightypork.gamecore.eventbus.clients.DelegatingClient;
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public abstract class LayeredScreen extends BaseScreen {
|
||||
public abstract class LayeredScreen extends Screen {
|
||||
|
||||
private class LayersClient implements DelegatingClient {
|
||||
|
||||
|
||||
@@ -2,34 +2,157 @@ package mightypork.gamecore.gui.screens;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.app.AppSubModule;
|
||||
import mightypork.gamecore.gui.events.LayoutChangeEvent;
|
||||
import mightypork.gamecore.gui.events.LayoutChangeListener;
|
||||
import mightypork.gamecore.input.KeyBinder;
|
||||
import mightypork.gamecore.input.KeyBindingPool;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.render.DisplaySystem;
|
||||
import mightypork.gamecore.render.Render;
|
||||
import mightypork.gamecore.render.Renderable;
|
||||
import mightypork.gamecore.util.annot.DefaultImpl;
|
||||
import mightypork.gamecore.util.math.constraints.rect.Rect;
|
||||
import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound;
|
||||
|
||||
|
||||
/**
|
||||
* Game screen
|
||||
* Screen class.
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public interface Screen extends Renderable, RectBound, AppAccess {
|
||||
public abstract class Screen extends AppSubModule implements Renderable, RectBound, AppAccess, KeyBinder, LayoutChangeListener {
|
||||
|
||||
private final KeyBindingPool keybindings = new KeyBindingPool();
|
||||
|
||||
private volatile boolean active;
|
||||
private volatile boolean needSetupViewport = false;
|
||||
|
||||
|
||||
/**
|
||||
* @param app app access
|
||||
*/
|
||||
public Screen(AppAccess app) {
|
||||
super(app);
|
||||
|
||||
// disable events initially
|
||||
setListening(false);
|
||||
|
||||
addChildClient(keybindings);
|
||||
}
|
||||
|
||||
|
||||
private void fireLayoutChangeEvent()
|
||||
{
|
||||
getEventBus().sendDirectToChildren(this, new LayoutChangeEvent());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void bindKey(KeyStroke stroke, Runnable task)
|
||||
{
|
||||
keybindings.bindKey(stroke, task);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void unbindKey(KeyStroke stroke)
|
||||
{
|
||||
keybindings.unbindKey(stroke);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepare for being shown
|
||||
*
|
||||
* @param shown true to show, false to hide
|
||||
*/
|
||||
void setActive(boolean shown);
|
||||
public final void setActive(boolean shown)
|
||||
{
|
||||
if (shown) {
|
||||
active = true;
|
||||
needSetupViewport = true;
|
||||
|
||||
fireLayoutChangeEvent();
|
||||
onScreenEnter();
|
||||
|
||||
// enable events
|
||||
setListening(true);
|
||||
|
||||
} else {
|
||||
onScreenLeave();
|
||||
|
||||
active = false;
|
||||
|
||||
// disable events
|
||||
setListening(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return true if screen is the current screen
|
||||
*/
|
||||
boolean isActive();
|
||||
public final boolean isActive()
|
||||
{
|
||||
return active;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLayoutChanged()
|
||||
{
|
||||
if (!isActive()) return;
|
||||
|
||||
needSetupViewport = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final Rect getRect()
|
||||
{
|
||||
return getDisplay().getRect();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render()
|
||||
{
|
||||
if (!isActive()) return;
|
||||
|
||||
if (needSetupViewport) {
|
||||
Render.setupOrtho(DisplaySystem.getSize());
|
||||
}
|
||||
|
||||
Render.pushState();
|
||||
|
||||
renderScreen();
|
||||
|
||||
Render.popState();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return screen identifier to be used for requests.
|
||||
* Called when the screen becomes active
|
||||
*/
|
||||
String getName();
|
||||
@DefaultImpl
|
||||
protected void onScreenEnter()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when the screen is no longer active
|
||||
*/
|
||||
@DefaultImpl
|
||||
protected void onScreenLeave()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render screen contents (context is ready for 2D rendering)
|
||||
*/
|
||||
protected abstract void renderScreen();
|
||||
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public class ScreenRegistry extends AppModule implements ScreenRequestListener,
|
||||
*
|
||||
* @param screen added screen
|
||||
*/
|
||||
public void addScreen(Screen screen)
|
||||
public void addScreen(String name, Screen screen)
|
||||
{
|
||||
screens.put(screen.getName(), screen);
|
||||
screens.put(name, screen);
|
||||
addChildClient(screen);
|
||||
}
|
||||
|
||||
|
||||
+24
-29
@@ -1,9 +1,10 @@
|
||||
package mightypork.gamecore.gui.screens;
|
||||
package mightypork.gamecore.gui.screens.impl;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.gui.components.painters.QuadPainter;
|
||||
import mightypork.gamecore.gui.events.ScreenRequestEvent;
|
||||
import mightypork.gamecore.gui.screens.Overlay;
|
||||
import mightypork.gamecore.util.math.Easing;
|
||||
import mightypork.gamecore.util.math.color.Color;
|
||||
import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated;
|
||||
@@ -12,17 +13,17 @@ import mightypork.rogue.events.ActionRequest;
|
||||
import mightypork.rogue.events.ActionRequest.RequestType;
|
||||
|
||||
|
||||
public class CrossfadeOverlay extends Overlay implements CrossfadeRequest.Listener {
|
||||
public class CrossfadeOverlay extends Overlay {
|
||||
|
||||
private static final double T_IN = 0.5;
|
||||
private static final double T_OUT = 0.7;
|
||||
|
||||
NumAnimated level = new NumAnimated(0);
|
||||
NumAnimated blackLevel = new NumAnimated(0);
|
||||
|
||||
Color color = Color.dark(level);
|
||||
Color color = Color.dark(blackLevel);
|
||||
String requestedScreenName;
|
||||
|
||||
TimedTask tt = new TimedTask() {
|
||||
TimedTask revealTask = new TimedTask() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
@@ -32,51 +33,45 @@ public class CrossfadeOverlay extends Overlay implements CrossfadeRequest.Listen
|
||||
} else {
|
||||
getEventBus().send(new ScreenRequestEvent(requestedScreenName));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TimedTask tt2 = new TimedTask() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
level.setEasing(Easing.SINE_OUT);
|
||||
level.fadeOut(T_OUT);
|
||||
blackLevel.setEasing(Easing.SINE_OUT);
|
||||
blackLevel.fadeOut(T_OUT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public CrossfadeOverlay(AppAccess app)
|
||||
{
|
||||
public CrossfadeOverlay(AppAccess app) {
|
||||
super(app);
|
||||
|
||||
final QuadPainter qp = new QuadPainter(color);
|
||||
qp.setRect(root);
|
||||
root.add(qp);
|
||||
|
||||
updated.add(level);
|
||||
updated.add(tt);
|
||||
updated.add(tt2);
|
||||
updated.add(blackLevel);
|
||||
updated.add(revealTask);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getZIndex()
|
||||
{
|
||||
return Integer.MAX_VALUE - 1; // let FPS go on top
|
||||
return 10000; // not too high, so app can put something on top
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void goToScreen(String screen)
|
||||
public void goToScreen(String screen, boolean fromDark)
|
||||
{
|
||||
tt.start(T_IN);
|
||||
tt2.start(T_IN);
|
||||
|
||||
level.setEasing(Easing.SINE_IN);
|
||||
level.fadeIn(T_IN);
|
||||
|
||||
requestedScreenName = screen;
|
||||
|
||||
if (fromDark) {
|
||||
blackLevel.setTo(1);
|
||||
revealTask.run();
|
||||
} else {
|
||||
revealTask.start(T_IN);
|
||||
|
||||
blackLevel.setEasing(Easing.SINE_IN);
|
||||
blackLevel.fadeIn(T_IN);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+8
-4
@@ -1,26 +1,30 @@
|
||||
package mightypork.rogue.screens.test_cat_sound;
|
||||
package mightypork.gamecore.gui.screens.impl;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.components.painters.QuadPainter;
|
||||
import mightypork.gamecore.gui.screens.BaseScreen;
|
||||
import mightypork.gamecore.gui.screens.Screen;
|
||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||
import mightypork.gamecore.util.math.color.Color;
|
||||
|
||||
|
||||
public class LayerColor extends ScreenLayer {
|
||||
|
||||
public LayerColor(BaseScreen screen, Color color)
|
||||
private int zIndex;
|
||||
|
||||
|
||||
public LayerColor(Screen screen, Color color, int zIndex)
|
||||
{
|
||||
super(screen);
|
||||
|
||||
root.add(new QuadPainter(color));
|
||||
this.zIndex = zIndex;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getZIndex()
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
return this.zIndex;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class FontRenderer {
|
||||
{
|
||||
Render.pushMatrix();
|
||||
|
||||
Render.translateXY(pos.round());
|
||||
Render.translateXY(pos);
|
||||
Render.scaleXY(getScale(height));
|
||||
|
||||
font.draw(text, color);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Ion {
|
||||
try {
|
||||
objClass.getConstructor();
|
||||
} catch (NoSuchMethodException | SecurityException e) {
|
||||
throw new IllegalArgumentException("Class " + Log.str(objClass) + " doesn't have an implicit constructor.");
|
||||
throw new RuntimeException("Class " + Log.str(objClass) + " doesn't have an implicit constructor.");
|
||||
}
|
||||
|
||||
registered[mark] = objClass;
|
||||
|
||||
@@ -46,7 +46,10 @@ public class Coord implements IonObjBundled, IonObjBinary {
|
||||
{
|
||||
return make(0, 0);
|
||||
}
|
||||
|
||||
|
||||
public Coord() {
|
||||
// for ion
|
||||
}
|
||||
|
||||
public Coord(int x, int y) {
|
||||
super();
|
||||
|
||||
@@ -3,40 +3,50 @@ package mightypork.gamecore.util.math.algo;
|
||||
|
||||
public class Sides {
|
||||
|
||||
public static final byte NW = (byte) 0b10000000;
|
||||
public static final byte N = (byte) 0b01000000;
|
||||
public static final byte NE = (byte) 0b00100000;
|
||||
public static final byte E = (byte) 0b00010000;
|
||||
public static final byte SE = (byte) 0b00001000;
|
||||
public static final byte S = (byte) 0b00000100;
|
||||
public static final byte SW = (byte) 0b00000010;
|
||||
public static final byte W = (byte) 0b00000001;
|
||||
public static final byte MASK_NW = (byte) 0b10000000;
|
||||
public static final byte MASK_N = (byte) 0b01000000;
|
||||
public static final byte MASK_NE = (byte) 0b00100000;
|
||||
public static final byte MASK_E = (byte) 0b00010000;
|
||||
public static final byte MASK_SE = (byte) 0b00001000;
|
||||
public static final byte MASK_S = (byte) 0b00000100;
|
||||
public static final byte MASK_SW = (byte) 0b00000010;
|
||||
public static final byte MASK_W = (byte) 0b00000001;
|
||||
|
||||
public static final byte CARDINAL = N | S | E | W;
|
||||
public static final byte DIAGONAL = NE | NW | SE | SW;
|
||||
public static final byte CARDINAL = MASK_N | MASK_S | MASK_E | MASK_W;
|
||||
public static final byte DIAGONAL = MASK_NE | MASK_NW | MASK_SE | MASK_SW;
|
||||
|
||||
public static final byte NW_CORNER = W | NW | N;
|
||||
public static final byte NE_CORNER = E | NE | N;
|
||||
public static final byte SW_CORNER = W | SW | S;
|
||||
public static final byte SE_CORNER = E | SE | S;
|
||||
public static final byte NW_CORNER = MASK_W | MASK_NW | MASK_N;
|
||||
public static final byte NE_CORNER = MASK_E | MASK_NE | MASK_N;
|
||||
public static final byte SW_CORNER = MASK_W | MASK_SW | MASK_S;
|
||||
public static final byte SE_CORNER = MASK_E | MASK_SE | MASK_S;
|
||||
|
||||
public static final Step NW = Step.make(-1, -1);
|
||||
public static final Step N = Step.make(0, -1);
|
||||
public static final Step NE = Step.make(1, -1);
|
||||
public static final Step E = Step.make(1, 0);
|
||||
public static final Step SE = Step.make(1, 1);
|
||||
public static final Step S = Step.make(0, 1);
|
||||
public static final Step SW = Step.make(-1, 1);
|
||||
public static final Step W = Step.make(-1, 0);
|
||||
|
||||
//@formatter:off
|
||||
/** All sides, in the order of bits. */
|
||||
public final static Step[] allSides = {
|
||||
Step.make(-1, -1),
|
||||
Step.make(0, -1),
|
||||
Step.make(1, -1),
|
||||
Step.make(1, 0),
|
||||
Step.make(1, 1),
|
||||
Step.make(0, 1),
|
||||
Step.make(-1, 1),
|
||||
Step.make(-1, 0)
|
||||
NW,
|
||||
N,
|
||||
NE,
|
||||
E,
|
||||
SE,
|
||||
S,
|
||||
SW,
|
||||
W
|
||||
};
|
||||
|
||||
public final static Step[] cardinalSides = {
|
||||
Step.make(0, -1),
|
||||
Step.make(1, 0),
|
||||
Step.make(0, 1),
|
||||
Step.make(-1, 0)
|
||||
N,
|
||||
E,
|
||||
S,
|
||||
W
|
||||
};
|
||||
|
||||
//@formatter:on
|
||||
|
||||
@@ -43,7 +43,10 @@ public class Step implements IonObjBinary, IonObjBundled {
|
||||
|
||||
private byte x;
|
||||
private byte y;
|
||||
|
||||
|
||||
public Step() {
|
||||
// for ion
|
||||
}
|
||||
|
||||
public Step(int x, int y) {
|
||||
this.x = (byte) (x < 0 ? -1 : x > 0 ? 1 : 0);
|
||||
|
||||
@@ -13,6 +13,7 @@ public interface RGB {
|
||||
Color WHITE = Color.fromHex(0xFFFFFF);
|
||||
Color BLACK = Color.fromHex(0x000000);
|
||||
Color GRAY_DARK = Color.fromHex(0x808080);
|
||||
Color GRAY = Color.fromHex(0xA0A0A0);
|
||||
Color GRAY_LIGHT = Color.fromHex(0xC0C0C0);
|
||||
|
||||
Color RED = Color.fromHex(0xFF0000);
|
||||
|
||||
@@ -8,7 +8,7 @@ import mightypork.gamecore.app.BaseApp;
|
||||
import mightypork.gamecore.app.MainLoop;
|
||||
import mightypork.gamecore.eventbus.BusEvent;
|
||||
import mightypork.gamecore.eventbus.EventBus;
|
||||
import mightypork.gamecore.gui.screens.CrossfadeRequest;
|
||||
import mightypork.gamecore.gui.events.CrossfadeRequest;
|
||||
import mightypork.gamecore.gui.screens.ScreenRegistry;
|
||||
import mightypork.gamecore.input.InputSystem;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
@@ -21,11 +21,9 @@ import mightypork.gamecore.util.ion.Ion;
|
||||
import mightypork.rogue.events.ActionRequest;
|
||||
import mightypork.rogue.events.ActionRequest.RequestType;
|
||||
import mightypork.rogue.screens.FpsOverlay;
|
||||
import mightypork.rogue.screens.gamescreen.ScreenGame;
|
||||
import mightypork.rogue.screens.main_menu.ScreenMainMenu;
|
||||
import mightypork.rogue.screens.game.ScreenGame;
|
||||
import mightypork.rogue.screens.menu.ScreenMainMenu;
|
||||
import mightypork.rogue.screens.test_bouncyboxes.ScreenTestBouncy;
|
||||
import mightypork.rogue.screens.test_cat_sound.ScreenTestCat;
|
||||
import mightypork.rogue.screens.test_render.ScreenTestRender;
|
||||
import mightypork.rogue.world.WorldProvider;
|
||||
import mightypork.rogue.world.item.Item;
|
||||
import mightypork.rogue.world.level.Level;
|
||||
@@ -61,8 +59,6 @@ public final class App extends BaseApp {
|
||||
{
|
||||
Config.init();
|
||||
Config.save();
|
||||
|
||||
WorldProvider.init(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,11 +111,13 @@ public final class App extends BaseApp {
|
||||
{
|
||||
super.initScreens(screens);
|
||||
|
||||
screens.addScreen(new ScreenTestBouncy(this));
|
||||
screens.addScreen(new ScreenTestCat(this));
|
||||
screens.addScreen(new ScreenTestRender(this));
|
||||
screens.addScreen(new ScreenMainMenu(this));
|
||||
screens.addScreen(new ScreenGame(this));
|
||||
/* game screen references world provider instance */
|
||||
WorldProvider.init(this);
|
||||
|
||||
screens.addScreen("test.bouncy", new ScreenTestBouncy(this));
|
||||
|
||||
screens.addScreen("menu", new ScreenMainMenu(this));
|
||||
screens.addScreen("game", new ScreenGame(this));
|
||||
|
||||
screens.addOverlay(new FpsOverlay(this));
|
||||
}
|
||||
@@ -131,18 +129,10 @@ public final class App extends BaseApp {
|
||||
// this will work only with reusable events (such as requests)
|
||||
bindEventToKey(new ActionRequest(RequestType.FULLSCREEN), Keys.F11);
|
||||
bindEventToKey(new ActionRequest(RequestType.SCREENSHOT), Keys.F2);
|
||||
bindEventToKey(new CrossfadeRequest(null), Keys.L_CONTROL, Keys.Q);
|
||||
bindEventToKey(new CrossfadeRequest("main_menu"), Keys.L_CONTROL, Keys.M);
|
||||
|
||||
// TODO tmp
|
||||
getInput().bindKey(new KeyStroke(Keys.N), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
WorldProvider.get().createWorld(Double.doubleToLongBits(Math.random()));
|
||||
}
|
||||
});
|
||||
bindEventToKey(new CrossfadeRequest(null), Keys.L_CONTROL, Keys.Q);
|
||||
|
||||
bindEventToKey(new CrossfadeRequest("menu"), Keys.ESCAPE);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,6 +162,6 @@ public final class App extends BaseApp {
|
||||
// TODO tmp
|
||||
WorldProvider.get().createWorld(42);
|
||||
|
||||
getEventBus().send(new CrossfadeRequest("game_screen"));
|
||||
getEventBus().send(new CrossfadeRequest("menu", true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,10 +63,6 @@ public final class Res {
|
||||
GLTexture texture;
|
||||
QuadGrid tiles;
|
||||
|
||||
// tests
|
||||
texture = textures.loadTexture("test.kitten", "/res/img/kitten.png", FilterMode.LINEAR, WrapMode.CLAMP);
|
||||
texture = textures.loadTexture("test.kitten2", "/res/img/kitten_npot.png", FilterMode.LINEAR, WrapMode.CLAMP);
|
||||
|
||||
// gui
|
||||
texture = textures.loadTexture("gui1", "/res/img/gui1.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
final QuadGrid gui = texture.grid(4, 4);
|
||||
@@ -85,14 +81,16 @@ public final class Res {
|
||||
textures.addSheet("sprite.player", tiles.makeSheet(0, 0, 4, 1));
|
||||
|
||||
// small sheet
|
||||
texture = textures.loadTexture("tiles16", "/res/img/tiles16.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
texture = textures.loadTexture("tiles", "/res/img/tiles16.png", FilterMode.NEAREST, WrapMode.CLAMP);
|
||||
tiles = texture.grid(8, 8);
|
||||
|
||||
textures.addSheet("tile.floor.dark", tiles.makeSheet(0, 1, 5, 1));
|
||||
textures.addSheet("tile.wall.brick", tiles.makeSheet(0, 0, 5, 1));
|
||||
textures.addSheet("tile.brick.floor", tiles.makeSheet(0, 1, 5, 1));
|
||||
textures.addSheet("tile.brick.wall", tiles.makeSheet(0, 0, 5, 1));
|
||||
|
||||
textures.addQuad("tile.door.closed", tiles.makeQuad(1, 2));
|
||||
textures.addQuad("tile.door.open", tiles.makeQuad(2, 2));
|
||||
textures.addSheet("tile.brick.door.closed", tiles.makeSheet(1, 2, 1, 1));
|
||||
textures.addSheet("tile.brick.door.open", tiles.makeSheet(2, 2, 1, 1));
|
||||
|
||||
textures.addSheet("tile.brick.passage", tiles.makeSheet(3, 2, 2, 1));
|
||||
|
||||
textures.addQuad("tile.shadow.n", tiles.makeQuad(0, 7));
|
||||
textures.addQuad("tile.shadow.s", tiles.makeQuad(0, 7).flipY());
|
||||
@@ -120,8 +118,6 @@ public final class Res {
|
||||
private static void loadSounds()
|
||||
{
|
||||
sounds.addEffect("gui.shutter", "/res/audio/shutter.ogg", 1, 1);
|
||||
|
||||
//sounds.addLoop("test.wilderness", "/res/audio/wilderness.ogg", 1, 1, 3, 3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FpsOverlay extends Overlay {
|
||||
});
|
||||
|
||||
tp.setRect(constraint);
|
||||
tp.setShadow(Color.BLACK, Vect.make(tp.height().div(16)));
|
||||
tp.setShadow(Color.BLACK, Vect.make(tp.height().div(16).round()));
|
||||
|
||||
root.add(tp);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.gamescreen;
|
||||
package mightypork.rogue.screens.game;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.AlignX;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.gamescreen;
|
||||
package mightypork.rogue.screens.game;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.AlignX;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.gamescreen;
|
||||
package mightypork.rogue.screens.game;
|
||||
|
||||
|
||||
import mightypork.gamecore.eventbus.events.Updateable;
|
||||
+17
-8
@@ -1,27 +1,36 @@
|
||||
package mightypork.rogue.screens.gamescreen;
|
||||
package mightypork.rogue.screens.game;
|
||||
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.gui.screens.LayeredScreen;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.input.Keys;
|
||||
import mightypork.rogue.world.WorldProvider;
|
||||
|
||||
|
||||
public class ScreenGame extends LayeredScreen {
|
||||
|
||||
|
||||
private Random rand = new Random();
|
||||
|
||||
|
||||
public ScreenGame(AppAccess app)
|
||||
{
|
||||
super(app);
|
||||
|
||||
addLayer(new HudLayer(this));
|
||||
addLayer(new WorldLayer(this));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "game_screen";
|
||||
|
||||
bindKey(new KeyStroke(Keys.N), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
WorldProvider.get().createWorld(rand .nextLong());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.gamescreen;
|
||||
package mightypork.rogue.screens.game;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.screens.Screen;
|
||||
+16
-10
@@ -1,12 +1,12 @@
|
||||
package mightypork.rogue.screens.main_menu;
|
||||
package mightypork.rogue.screens.menu;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.AlignX;
|
||||
import mightypork.gamecore.gui.components.ClickableComponent;
|
||||
import mightypork.gamecore.gui.components.painters.TextPainter;
|
||||
import mightypork.gamecore.input.InputSystem;
|
||||
import mightypork.gamecore.resources.fonts.GLFont;
|
||||
import mightypork.gamecore.util.math.color.Color;
|
||||
import mightypork.gamecore.util.math.constraints.num.Num;
|
||||
import mightypork.gamecore.util.math.constraints.vect.Vect;
|
||||
import mightypork.gamecore.util.math.constraints.vect.mutable.VectVar;
|
||||
import mightypork.rogue.Res;
|
||||
@@ -16,18 +16,20 @@ class MenuButton extends ClickableComponent {
|
||||
|
||||
private static GLFont font = Res.getFont("main_menu_button");
|
||||
private final TextPainter painter;
|
||||
private final VectVar offset = Vect.makeVar();
|
||||
private final Vect offsetActive = Vect.make(this.height().perc(-5), Num.ZERO);
|
||||
|
||||
private final VectVar offset = Vect.makeVar();
|
||||
private final Vect offsetPassive = height().div(16).toVectXY();
|
||||
private final Vect offsetPassive2 = height().div(24).toVectXY();
|
||||
|
||||
private final Color color;
|
||||
|
||||
|
||||
public MenuButton(String text, Color color)
|
||||
{
|
||||
public MenuButton(String text, Color color) {
|
||||
this.color = color;
|
||||
|
||||
this.painter = new TextPainter(font, AlignX.CENTER, this.color, text);
|
||||
this.painter.setRect(this.shrink(this.height().perc(8)).move(offset));
|
||||
this.painter.setShadow(Color.BLACK.withAlpha(0.3), height().div(24).toVectXY());
|
||||
this.painter.setRect(this);
|
||||
this.painter.setShadow(Color.BLACK.withAlpha(0.3), offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +37,13 @@ class MenuButton extends ClickableComponent {
|
||||
protected void renderComponent()
|
||||
{
|
||||
if (isMouseOver()) {
|
||||
offset.setTo(offsetActive);
|
||||
if (InputSystem.isMouseButtonDown(0)) {
|
||||
offset.setTo(Vect.ZERO);
|
||||
} else {
|
||||
offset.setTo(offsetPassive2);
|
||||
}
|
||||
} else {
|
||||
offset.setTo(Vect.ZERO);
|
||||
offset.setTo(offsetPassive);
|
||||
}
|
||||
|
||||
painter.render();
|
||||
+26
-46
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.main_menu;
|
||||
package mightypork.rogue.screens.menu;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.Action;
|
||||
@@ -6,8 +6,8 @@ import mightypork.gamecore.gui.AlignX;
|
||||
import mightypork.gamecore.gui.components.layout.GridLayout;
|
||||
import mightypork.gamecore.gui.components.painters.QuadPainter;
|
||||
import mightypork.gamecore.gui.components.painters.TextPainter;
|
||||
import mightypork.gamecore.gui.screens.BaseScreen;
|
||||
import mightypork.gamecore.gui.screens.CrossfadeRequest;
|
||||
import mightypork.gamecore.gui.events.CrossfadeRequest;
|
||||
import mightypork.gamecore.gui.screens.Screen;
|
||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||
import mightypork.gamecore.util.math.color.pal.COMMODORE;
|
||||
import mightypork.gamecore.util.math.color.pal.PAL16;
|
||||
@@ -18,8 +18,7 @@ import mightypork.rogue.Res;
|
||||
|
||||
class MenuLayer extends ScreenLayer {
|
||||
|
||||
public MenuLayer(BaseScreen screen)
|
||||
{
|
||||
public MenuLayer(Screen screen) {
|
||||
super(screen);
|
||||
|
||||
init();
|
||||
@@ -39,49 +38,31 @@ class MenuLayer extends ScreenLayer {
|
||||
|
||||
root.add(layout);
|
||||
|
||||
TextPainter tp;
|
||||
MenuButton b0, b1, b2, b3, b4;
|
||||
tp = new TextPainter(Res.getFont("main_menu_title"), AlignX.CENTER, COMMODORE.PURPLE, "Rogue!");
|
||||
b0 = new MenuButton("World Test", PAL16.SLIMEGREEN);
|
||||
b1 = new MenuButton("Gradientz", PAL16.BLAZE);
|
||||
b2 = new MenuButton("Bouncy Cubes", PAL16.CLOUDBLUE);
|
||||
b3 = new MenuButton("Flying Cat", PAL16.PIGMEAT);
|
||||
b4 = new MenuButton("Bye!", PAL16.BLOODRED);
|
||||
|
||||
int r = 0;
|
||||
|
||||
TextPainter tp = new TextPainter(Res.getFont("main_menu_title"), AlignX.CENTER, COMMODORE.PURPLE, "Rogue!");
|
||||
layout.put(tp, r, 0, 3, 1);
|
||||
r += 5;
|
||||
layout.put(b0, r, 0, 2, 1);
|
||||
r += 3;
|
||||
layout.put(b1, r, 0, 2, 1);
|
||||
r += 2;
|
||||
layout.put(b2, r, 0, 2, 1);
|
||||
r += 2;
|
||||
layout.put(b3, r, 0, 2, 1);
|
||||
r += 3;
|
||||
layout.put(b4, r, 0, 2, 1);
|
||||
|
||||
root.add(layout);
|
||||
b0.setAction(new Action() {
|
||||
MenuButton btn;
|
||||
|
||||
|
||||
// world button
|
||||
btn = new MenuButton("World Test", PAL16.SLIMEGREEN);
|
||||
btn.setAction(new Action() {
|
||||
|
||||
@Override
|
||||
protected void execute()
|
||||
{
|
||||
getEventBus().send(new CrossfadeRequest("game_screen"));
|
||||
getEventBus().send(new CrossfadeRequest("game"));
|
||||
}
|
||||
});
|
||||
layout.put(btn, r, 0, 2, 1);
|
||||
r += 3;
|
||||
|
||||
b1.setAction(new Action() {
|
||||
|
||||
@Override
|
||||
protected void execute()
|
||||
{
|
||||
getEventBus().send(new CrossfadeRequest("test.render"));
|
||||
}
|
||||
});
|
||||
|
||||
b2.setAction(new Action() {
|
||||
// bouncy text button
|
||||
btn = new MenuButton("Bouncy Cubes Test", PAL16.CLOUDBLUE);
|
||||
btn.setAction(new Action() {
|
||||
|
||||
@Override
|
||||
protected void execute()
|
||||
@@ -89,18 +70,13 @@ class MenuLayer extends ScreenLayer {
|
||||
getEventBus().send(new CrossfadeRequest("test.bouncy"));
|
||||
}
|
||||
});
|
||||
layout.put(btn, r, 0, 2, 1);
|
||||
r += 3;
|
||||
|
||||
b3.setAction(new Action() {
|
||||
|
||||
@Override
|
||||
protected void execute()
|
||||
{
|
||||
getEventBus().send(new CrossfadeRequest("test.cat"));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
b4.setAction(new Action() {
|
||||
// quit button
|
||||
btn = new MenuButton("Bye!", PAL16.BLOODRED);
|
||||
btn.setAction(new Action() {
|
||||
|
||||
@Override
|
||||
protected void execute()
|
||||
@@ -108,6 +84,10 @@ class MenuLayer extends ScreenLayer {
|
||||
getEventBus().send(new CrossfadeRequest(null)); // null -> fade and halt
|
||||
}
|
||||
});
|
||||
layout.put(btn, r, 0, 2, 1);
|
||||
|
||||
|
||||
root.add(layout);
|
||||
}
|
||||
|
||||
|
||||
+1
-9
@@ -1,4 +1,4 @@
|
||||
package mightypork.rogue.screens.main_menu;
|
||||
package mightypork.rogue.screens.menu;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
@@ -13,12 +13,4 @@ public class ScreenMainMenu extends LayeredScreen {
|
||||
|
||||
addLayer(new MenuLayer(this));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "main_menu";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import mightypork.gamecore.gui.AlignX;
|
||||
import mightypork.gamecore.gui.components.layout.RowHolder;
|
||||
import mightypork.gamecore.gui.components.painters.TextPainter;
|
||||
import mightypork.gamecore.gui.screens.BaseScreen;
|
||||
import mightypork.gamecore.gui.screens.Screen;
|
||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.input.Keys;
|
||||
@@ -23,7 +23,7 @@ public class LayerBouncyBoxes extends ScreenLayer {
|
||||
private RowHolder layout;
|
||||
|
||||
|
||||
public LayerBouncyBoxes(BaseScreen screen)
|
||||
public LayerBouncyBoxes(Screen screen)
|
||||
{
|
||||
super(screen);
|
||||
|
||||
|
||||
@@ -7,23 +7,10 @@ import mightypork.gamecore.gui.screens.LayeredScreen;
|
||||
|
||||
public class ScreenTestBouncy extends LayeredScreen {
|
||||
|
||||
private final LayerBouncyBoxes layer;
|
||||
|
||||
|
||||
public ScreenTestBouncy(AppAccess app)
|
||||
{
|
||||
public ScreenTestBouncy(AppAccess app) {
|
||||
super(app);
|
||||
|
||||
layer = new LayerBouncyBoxes(this);
|
||||
|
||||
addLayer(layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "test.bouncy";
|
||||
addLayer(new LayerBouncyBoxes(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
package mightypork.rogue.screens.test_cat_sound;
|
||||
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mightypork.gamecore.gui.AlignX;
|
||||
import mightypork.gamecore.gui.components.painters.ImagePainter;
|
||||
import mightypork.gamecore.gui.components.painters.QuadPainter;
|
||||
import mightypork.gamecore.gui.components.painters.TextPainter;
|
||||
import mightypork.gamecore.gui.screens.BaseScreen;
|
||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.input.Keys;
|
||||
import mightypork.gamecore.input.events.MouseButtonEvent;
|
||||
import mightypork.gamecore.input.events.MouseButtonListener;
|
||||
import mightypork.gamecore.util.math.Easing;
|
||||
import mightypork.gamecore.util.math.color.Color;
|
||||
import mightypork.gamecore.util.math.constraints.num.mutable.NumAnimated;
|
||||
import mightypork.gamecore.util.math.constraints.rect.Rect;
|
||||
import mightypork.gamecore.util.math.constraints.vect.Vect;
|
||||
import mightypork.gamecore.util.math.constraints.vect.mutable.VectAnimated;
|
||||
import mightypork.rogue.Res;
|
||||
|
||||
|
||||
public class LayerFlyingCat extends ScreenLayer implements MouseButtonListener {
|
||||
|
||||
private final NumAnimated size = new NumAnimated(300, Easing.SINE_BOTH);
|
||||
private final VectAnimated cat_position = VectAnimated.makeVar(Easing.ELASTIC_OUT);
|
||||
|
||||
private final Random rand = new Random();
|
||||
|
||||
|
||||
public LayerFlyingCat(BaseScreen screen)
|
||||
{
|
||||
super(screen);
|
||||
|
||||
// timing
|
||||
updated.add(size);
|
||||
updated.add(cat_position);
|
||||
size.setTo(root.height().perc(60));
|
||||
|
||||
// cat
|
||||
cat_position.setTo(getDisplay().getCenter());
|
||||
cat_position.setDefaultDuration(3);
|
||||
|
||||
final ImagePainter cat = new ImagePainter(Res.getTxQuad("test.kitten2"));
|
||||
cat.setRect(Rect.make(size).centerTo(cat_position));
|
||||
cat.enableCaching(false);
|
||||
|
||||
// frame around cat
|
||||
final QuadPainter cat_frame = QuadPainter.gradV(Color.YELLOW, Color.RED);
|
||||
cat_frame.setRect(cat.grow(cat.height().mul(0.05)));
|
||||
cat_frame.enableCaching(false);
|
||||
|
||||
// frame shadow
|
||||
final QuadPainter cat_shadow = new QuadPainter(Color.dark(0.4));
|
||||
cat_shadow.setRect(cat_frame.move(Vect.make(cat.height().mul(0.05))));
|
||||
cat_shadow.enableCaching(false);
|
||||
|
||||
// add to root layout
|
||||
root.add(cat_shadow);
|
||||
root.add(cat_frame);
|
||||
root.add(cat);
|
||||
|
||||
// Meow
|
||||
final TextPainter tp = new TextPainter(Res.getFont("press_start"));
|
||||
tp.setAlign(AlignX.CENTER);
|
||||
tp.setColor(Color.YELLOW);
|
||||
tp.setText("Meow!");
|
||||
tp.setShadow(Color.dark(0.5), Vect.make(tp.height().div(16)));
|
||||
tp.setRect(Rect.make(cat.height().half()).centerTo(mouse));
|
||||
tp.enableCaching(false);
|
||||
root.add(tp);
|
||||
|
||||
/*
|
||||
* Register keys
|
||||
*/
|
||||
bindKey(new KeyStroke(Keys.RETURN), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
cat_position.setTo(getDisplay().getCenter());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void receive(MouseButtonEvent event)
|
||||
{
|
||||
if (!event.isDown()) return;
|
||||
|
||||
cat_position.animate(event.getPos());
|
||||
|
||||
final double newSize = root.height().perc(10 + rand.nextInt(40)).value();
|
||||
|
||||
size.animate(newSize, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getZIndex()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package mightypork.rogue.screens.test_cat_sound;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.gui.screens.LayeredScreen;
|
||||
import mightypork.gamecore.input.KeyStroke;
|
||||
import mightypork.gamecore.input.Keys;
|
||||
import mightypork.rogue.events.ActionRequest;
|
||||
import mightypork.rogue.events.ActionRequest.RequestType;
|
||||
|
||||
|
||||
public class ScreenTestCat extends LayeredScreen {
|
||||
|
||||
public ScreenTestCat(AppAccess app)
|
||||
{
|
||||
super(app);
|
||||
|
||||
addLayer(new LayerFlyingCat(this));
|
||||
|
||||
bindKey(new KeyStroke(Keys.ESCAPE), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
getSoundSystem().fadeOutAllLoops();
|
||||
getEventBus().sendDelayed(new ActionRequest(RequestType.SHUTDOWN), 3);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onScreenEnter()
|
||||
{
|
||||
getSoundSystem().fadeOutAllLoops();
|
||||
//Res.getLoop("test.wilderness").fadeIn();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onScreenLeave()
|
||||
{
|
||||
//Res.getLoop("test.wilderness").fadeOut();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "test.cat";
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package mightypork.rogue.screens.test_render;
|
||||
|
||||
|
||||
import mightypork.gamecore.gui.screens.BaseScreen;
|
||||
import mightypork.gamecore.gui.screens.ScreenLayer;
|
||||
import mightypork.gamecore.render.Render;
|
||||
import mightypork.gamecore.util.math.color.Color;
|
||||
import mightypork.gamecore.util.math.constraints.rect.proxy.RectBound;
|
||||
|
||||
|
||||
public class LayerTestGradient extends ScreenLayer {
|
||||
|
||||
private final RectBound pos1;
|
||||
private final RectBound pos2;
|
||||
|
||||
|
||||
public LayerTestGradient(BaseScreen screen)
|
||||
{
|
||||
super(screen);
|
||||
|
||||
pos1 = root.topEdge().growDown(64);
|
||||
pos2 = root.leftEdge().growUp(-64).growRight(64);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render()
|
||||
{
|
||||
Render.quadColor(root, Color.WHITE, Color.BLUE, Color.BLACK, Color.MAGENTA);
|
||||
Render.quadGradH(pos1.getRect(), Color.GREEN, Color.RED);
|
||||
Render.quadGradV(pos2.getRect(), Color.WHITE, Color.MAGENTA);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getZIndex()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package mightypork.rogue.screens.test_render;
|
||||
|
||||
|
||||
import mightypork.gamecore.app.AppAccess;
|
||||
import mightypork.gamecore.gui.screens.LayeredScreen;
|
||||
|
||||
|
||||
public class ScreenTestRender extends LayeredScreen {
|
||||
|
||||
public ScreenTestRender(AppAccess app)
|
||||
{
|
||||
super(app);
|
||||
|
||||
addLayer(new LayerTestGradient(this));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "test.render";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class WorldRenderer extends RectProxy {
|
||||
|
||||
// batch rendering of the tiles
|
||||
if (USE_BATCH_RENDERING) {
|
||||
Render.enterBatchTexturedQuadMode(Res.getTexture("tiles16"));
|
||||
Render.enterBatchTexturedQuadMode(Res.getTexture("tiles"));
|
||||
}
|
||||
|
||||
for (trc.pos.x = x1; trc.pos.x <= x2; trc.pos.x++) {
|
||||
|
||||
@@ -6,19 +6,19 @@ import java.util.Random;
|
||||
import mightypork.gamecore.util.math.algo.Coord;
|
||||
import mightypork.rogue.world.gen.rooms.DeadEndRoom;
|
||||
import mightypork.rogue.world.gen.rooms.SimpleRectRoom;
|
||||
import mightypork.rogue.world.gen.themes.ThemeDungeon;
|
||||
import mightypork.rogue.world.gen.themes.ThemeBrick;
|
||||
import mightypork.rogue.world.level.Level;
|
||||
|
||||
|
||||
public class LevelGenerator {
|
||||
|
||||
public static final Theme DUNGEON_THEME = new ThemeDungeon();
|
||||
public static final MapTheme DUNGEON_THEME = new ThemeBrick();
|
||||
|
||||
public static final RoomBuilder ROOM_SQUARE = new SimpleRectRoom();
|
||||
private static final RoomBuilder DEAD_END = new DeadEndRoom();
|
||||
|
||||
|
||||
public static Level build(long seed, int complexity, Theme theme)
|
||||
public static Level build(long seed, int complexity, MapTheme theme)
|
||||
{
|
||||
final Random rand = new Random(seed + 13);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class LevelGenerator {
|
||||
|
||||
for (int i = 0; i < 2 + complexity / 2 + rand.nextInt((int) (1 + complexity * 0.3)); i++) {
|
||||
map.addRoom(ROOM_SQUARE);
|
||||
if (rand.nextInt(4) > 0) map.addRoom(DEAD_END);
|
||||
if (rand.nextInt(6) > 0) map.addRoom(DEAD_END);
|
||||
}
|
||||
|
||||
map.buildCorridors();
|
||||
|
||||
+3
-1
@@ -9,7 +9,7 @@ import mightypork.rogue.world.tile.TileModel;
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public interface Theme {
|
||||
public interface MapTheme {
|
||||
|
||||
TileModel wall();
|
||||
|
||||
@@ -18,4 +18,6 @@ public interface Theme {
|
||||
|
||||
|
||||
TileModel door();
|
||||
|
||||
TileModel passage();
|
||||
}
|
||||
@@ -13,5 +13,5 @@ import mightypork.gamecore.util.math.algo.Coord;
|
||||
*/
|
||||
public interface RoomBuilder {
|
||||
|
||||
RoomDesc buildToFit(ScratchMap map, Theme theme, Random rand, Coord center);
|
||||
RoomDesc buildToFit(ScratchMap map, MapTheme theme, Random rand, Coord center);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ScratchMap {
|
||||
return 60;
|
||||
|
||||
case DOOR:
|
||||
case PASSAGE:
|
||||
return 10;
|
||||
|
||||
case FLOOR:
|
||||
@@ -97,14 +98,14 @@ public class ScratchMap {
|
||||
Coord genMin;
|
||||
Coord genMax;
|
||||
|
||||
private final Theme theme;
|
||||
private final MapTheme theme;
|
||||
private final Random rand;
|
||||
private Coord enterPoint;
|
||||
|
||||
private static final boolean FIX_GLITCHES = true;
|
||||
|
||||
|
||||
public ScratchMap(int max_size, Theme theme, Random rand)
|
||||
public ScratchMap(int max_size, MapTheme theme, Random rand)
|
||||
{
|
||||
map = new Tile[max_size][max_size];
|
||||
|
||||
|
||||
@@ -4,22 +4,24 @@ package mightypork.rogue.world.gen.rooms;
|
||||
import java.util.Random;
|
||||
|
||||
import mightypork.gamecore.util.math.algo.Coord;
|
||||
import mightypork.gamecore.util.math.algo.Sides;
|
||||
import mightypork.rogue.world.gen.RoomBuilder;
|
||||
import mightypork.rogue.world.gen.RoomDesc;
|
||||
import mightypork.rogue.world.gen.ScratchMap;
|
||||
import mightypork.rogue.world.gen.Theme;
|
||||
import mightypork.rogue.world.gen.MapTheme;
|
||||
|
||||
|
||||
public class DeadEndRoom implements RoomBuilder {
|
||||
|
||||
@Override
|
||||
public RoomDesc buildToFit(ScratchMap map, Theme theme, Random rand, Coord center)
|
||||
public RoomDesc buildToFit(ScratchMap map, MapTheme theme, Random rand, Coord center)
|
||||
{
|
||||
|
||||
if (!map.isClear(center, center)) return null;
|
||||
Coord low = center.add(-1, -1);
|
||||
Coord high = center;
|
||||
if (!map.isClear(low, high)) return null;
|
||||
|
||||
map.set(center, theme.floor());
|
||||
|
||||
return new RoomDesc(center, center);
|
||||
return new RoomDesc(low, high);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@ import mightypork.gamecore.util.math.algo.Sides;
|
||||
import mightypork.rogue.world.gen.RoomBuilder;
|
||||
import mightypork.rogue.world.gen.RoomDesc;
|
||||
import mightypork.rogue.world.gen.ScratchMap;
|
||||
import mightypork.rogue.world.gen.Theme;
|
||||
import mightypork.rogue.world.gen.MapTheme;
|
||||
import mightypork.rogue.world.tile.TileModel;
|
||||
|
||||
|
||||
public class SimpleRectRoom implements RoomBuilder {
|
||||
|
||||
@Override
|
||||
public RoomDesc buildToFit(ScratchMap map, Theme theme, Random rand, Coord center)
|
||||
public RoomDesc buildToFit(ScratchMap map, MapTheme theme, Random rand, Coord center)
|
||||
{
|
||||
// half width, half height actually
|
||||
final int width = 2 + rand.nextInt(2);
|
||||
@@ -29,6 +30,8 @@ public class SimpleRectRoom implements RoomBuilder {
|
||||
map.border(min, max, theme.wall());
|
||||
map.protect(min, max);
|
||||
|
||||
boolean holes = rand.nextInt(4) == 0;
|
||||
|
||||
for (int i = 0; i <= 2 + rand.nextInt(6); i++) {
|
||||
final Coord door = min.copy();
|
||||
switch (rand.nextInt(4)) {
|
||||
@@ -51,11 +54,19 @@ public class SimpleRectRoom implements RoomBuilder {
|
||||
}
|
||||
|
||||
if ((map.findDoors(door) & Sides.CARDINAL) == 0) {
|
||||
map.set(door, theme.door());
|
||||
TileModel placed;
|
||||
switch (rand.nextInt(8)) {
|
||||
case 0:
|
||||
case 1:
|
||||
placed = theme.passage();
|
||||
break;
|
||||
default:
|
||||
placed = holes ? theme.floor() : theme.door();
|
||||
}
|
||||
map.set(door, placed);
|
||||
}
|
||||
}
|
||||
|
||||
return new RoomDesc(min.add(-1, -1), max);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-5
@@ -1,32 +1,38 @@
|
||||
package mightypork.rogue.world.gen.themes;
|
||||
|
||||
|
||||
import mightypork.rogue.world.gen.Theme;
|
||||
import mightypork.rogue.world.gen.MapTheme;
|
||||
import mightypork.rogue.world.tile.TileModel;
|
||||
import mightypork.rogue.world.tile.Tiles;
|
||||
|
||||
|
||||
// basic dungeon theme
|
||||
public class ThemeDungeon implements Theme {
|
||||
public class ThemeBrick implements MapTheme {
|
||||
|
||||
@Override
|
||||
public TileModel wall()
|
||||
{
|
||||
return Tiles.WALL_BRICK;
|
||||
return Tiles.BRICK_WALL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileModel floor()
|
||||
{
|
||||
return Tiles.FLOOR_DARK;
|
||||
return Tiles.BRICK_FLOOR;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileModel door()
|
||||
{
|
||||
return Tiles.DOOR;
|
||||
return Tiles.BRICK_DOOR;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileModel passage()
|
||||
{
|
||||
return Tiles.BRICK_PASSAGE;
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ public class Level implements MapAccess, IonObjBinary {
|
||||
public boolean canSpreadFrom(Coord pos)
|
||||
{
|
||||
final Tile t = getTile(pos);
|
||||
return t.isWalkable() && t.getType() != TileType.DOOR;
|
||||
return t.isWalkable() && !t.isDoor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public abstract class Tile implements IonObjBlob {
|
||||
|
||||
public final boolean isDoor()
|
||||
{
|
||||
return getType() == TileType.DOOR;
|
||||
return getType() == TileType.DOOR || getType() == TileType.PASSAGE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,16 +72,16 @@ public abstract class TileRenderer {
|
||||
if (trd.shadows == 0) return;
|
||||
final Rect rect = context.getRect();
|
||||
|
||||
if ((trd.shadows & Sides.NW) != 0) Render.quadTextured(rect, SH_NW);
|
||||
if ((trd.shadows & Sides.N) != 0) Render.quadTextured(rect, SH_N);
|
||||
if ((trd.shadows & Sides.NE) != 0) Render.quadTextured(rect, SH_NE);
|
||||
if ((trd.shadows & Sides.MASK_NW) != 0) Render.quadTextured(rect, SH_NW);
|
||||
if ((trd.shadows & Sides.MASK_N) != 0) Render.quadTextured(rect, SH_N);
|
||||
if ((trd.shadows & Sides.MASK_NE) != 0) Render.quadTextured(rect, SH_NE);
|
||||
|
||||
if ((trd.shadows & Sides.W) != 0) Render.quadTextured(rect, SH_W);
|
||||
if ((trd.shadows & Sides.E) != 0) Render.quadTextured(rect, SH_E);
|
||||
if ((trd.shadows & Sides.MASK_W) != 0) Render.quadTextured(rect, SH_W);
|
||||
if ((trd.shadows & Sides.MASK_E) != 0) Render.quadTextured(rect, SH_E);
|
||||
|
||||
if ((trd.shadows & Sides.SW) != 0) Render.quadTextured(rect, SH_SW);
|
||||
if ((trd.shadows & Sides.S) != 0) Render.quadTextured(rect, SH_S);
|
||||
if ((trd.shadows & Sides.SE) != 0) Render.quadTextured(rect, SH_SE);
|
||||
if ((trd.shadows & Sides.MASK_SW) != 0) Render.quadTextured(rect, SH_SW);
|
||||
if ((trd.shadows & Sides.MASK_S) != 0) Render.quadTextured(rect, SH_S);
|
||||
if ((trd.shadows & Sides.MASK_SE) != 0) Render.quadTextured(rect, SH_SE);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,15 +103,15 @@ public abstract class TileRenderer {
|
||||
if (ufog == 0) return;
|
||||
|
||||
final Rect rect = context.getRect();
|
||||
if ((ufog & Sides.NW_CORNER) == Sides.NW) Render.quadTextured(rect, UFOG_NW);
|
||||
if ((ufog & Sides.N) != 0) Render.quadTextured(rect, UFOG_N);
|
||||
if ((ufog & Sides.NE_CORNER) == Sides.NE) Render.quadTextured(rect, UFOG_NE);
|
||||
if ((ufog & Sides.NW_CORNER) == Sides.MASK_NW) Render.quadTextured(rect, UFOG_NW);
|
||||
if ((ufog & Sides.MASK_N) != 0) Render.quadTextured(rect, UFOG_N);
|
||||
if ((ufog & Sides.NE_CORNER) == Sides.MASK_NE) Render.quadTextured(rect, UFOG_NE);
|
||||
|
||||
if ((ufog & Sides.W) != 0) Render.quadTextured(rect, UFOG_W);
|
||||
if ((ufog & Sides.E) != 0) Render.quadTextured(rect, UFOG_E);
|
||||
if ((ufog & Sides.MASK_W) != 0) Render.quadTextured(rect, UFOG_W);
|
||||
if ((ufog & Sides.MASK_E) != 0) Render.quadTextured(rect, UFOG_E);
|
||||
|
||||
if ((ufog & Sides.SW_CORNER) == Sides.SW) Render.quadTextured(rect, UFOG_SW);
|
||||
if ((ufog & Sides.S) != 0) Render.quadTextured(rect, UFOG_S);
|
||||
if ((ufog & Sides.SE_CORNER) == Sides.SE) Render.quadTextured(rect, UFOG_SE);
|
||||
if ((ufog & Sides.SW_CORNER) == Sides.MASK_SW) Render.quadTextured(rect, UFOG_SW);
|
||||
if ((ufog & Sides.MASK_S) != 0) Render.quadTextured(rect, UFOG_S);
|
||||
if ((ufog & Sides.SE_CORNER) == Sides.MASK_SE) Render.quadTextured(rect, UFOG_SE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ public enum TileType
|
||||
/** Wall tile */
|
||||
WALL(RGB.GRAY_LIGHT, false),
|
||||
/** Door/gate tile */
|
||||
DOOR(PAL16.NEWPOOP, true);
|
||||
DOOR(PAL16.NEWPOOP, true),
|
||||
/** Passage (ie secret door) */
|
||||
PASSAGE(RGB.GRAY, true);
|
||||
|
||||
private final Color mapColor;
|
||||
private final boolean potentiallyWalkable;
|
||||
|
||||
@@ -11,6 +11,7 @@ import mightypork.rogue.world.tile.renderers.NullTileRenderer;
|
||||
import mightypork.rogue.world.tile.tiles.DoorTile;
|
||||
import mightypork.rogue.world.tile.tiles.FloorTile;
|
||||
import mightypork.rogue.world.tile.tiles.NullTile;
|
||||
import mightypork.rogue.world.tile.tiles.WallPassageTile;
|
||||
import mightypork.rogue.world.tile.tiles.WallTile;
|
||||
|
||||
|
||||
@@ -25,9 +26,10 @@ public final class Tiles {
|
||||
|
||||
public static final TileModel NULL = new TileModel(0, NullTile.class, new NullTileRenderer());
|
||||
|
||||
public static final TileModel FLOOR_DARK = new TileModel(10, FloorTile.class, new BasicTileRenderer("tile.floor.dark"));
|
||||
public static final TileModel WALL_BRICK = new TileModel(11, WallTile.class, new BasicTileRenderer("tile.wall.brick"));
|
||||
public static final TileModel DOOR = new TileModel(12, DoorTile.class, new DoorTileRenderer("tile.door.closed", "tile.door.open"));
|
||||
public static final TileModel BRICK_FLOOR = new TileModel(10, FloorTile.class, new BasicTileRenderer("tile.brick.floor"));
|
||||
public static final TileModel BRICK_WALL = new TileModel(11, WallTile.class, new BasicTileRenderer("tile.brick.wall"));
|
||||
public static final TileModel BRICK_DOOR = new TileModel(12, DoorTile.class, new DoorTileRenderer("tile.brick.door.closed", "tile.brick.door.open"));
|
||||
public static final TileModel BRICK_PASSAGE = new TileModel(13, WallPassageTile.class, new BasicTileRenderer("tile.brick.passage"));
|
||||
|
||||
|
||||
public static void register(int id, TileModel model)
|
||||
|
||||
@@ -3,6 +3,7 @@ package mightypork.rogue.world.tile.renderers;
|
||||
|
||||
import mightypork.gamecore.render.Render;
|
||||
import mightypork.gamecore.resources.textures.TxQuad;
|
||||
import mightypork.gamecore.resources.textures.TxSheet;
|
||||
import mightypork.gamecore.util.math.constraints.rect.Rect;
|
||||
import mightypork.rogue.Res;
|
||||
import mightypork.rogue.world.level.render.TileRenderContext;
|
||||
@@ -12,14 +13,14 @@ import mightypork.rogue.world.tile.TileRenderer;
|
||||
|
||||
public class DoorTileRenderer extends TileRenderer {
|
||||
|
||||
private final TxQuad closed;
|
||||
private final TxQuad open;
|
||||
private final TxSheet closed;
|
||||
private final TxSheet open;
|
||||
|
||||
|
||||
public DoorTileRenderer(String quadClosed, String quadOpen)
|
||||
{
|
||||
this.closed = Res.getTxQuad(quadClosed);
|
||||
this.open = Res.getTxQuad(quadOpen);
|
||||
this.closed = Res.getTxSheet(quadClosed);
|
||||
this.open = Res.getTxSheet(quadOpen);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +31,9 @@ public class DoorTileRenderer extends TileRenderer {
|
||||
final Rect rect = context.getRect();
|
||||
|
||||
if (t.isOccupied()) {
|
||||
Render.quadTextured(rect, open);
|
||||
Render.quadTextured(rect, open.getRandomQuad(context.getTileNoise()));
|
||||
} else {
|
||||
Render.quadTextured(rect, closed);
|
||||
Render.quadTextured(rect, closed.getRandomQuad(context.getTileNoise()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package mightypork.rogue.world.tile.tiles;
|
||||
|
||||
import mightypork.rogue.world.tile.TileModel;
|
||||
import mightypork.rogue.world.tile.TileRenderer;
|
||||
import mightypork.rogue.world.tile.TileType;
|
||||
|
||||
|
||||
/**
|
||||
* Collapsed wall that's walk-through
|
||||
*
|
||||
* @author MightyPork
|
||||
*/
|
||||
public class WallPassageTile extends SolidTile {
|
||||
|
||||
public WallPassageTile(TileModel model, TileRenderer renderer) {
|
||||
super(model, renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileType getType()
|
||||
{
|
||||
return TileType.PASSAGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWalkable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user