File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
core/src/main/java/com/squidpony/demo Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ # WFC Demo using Tiled
2
+
3
+ ## Controls
4
+
5
+ They're simple! Press ` q ` or ` Esc ` to exit. Press ` r ` to randomize the map.
6
+ Press ` PrintScreen ` to do nothing and let the OS handle taking a screenshot.
7
+ Press any other key to generate the next map in order.
8
+
9
+ This starts with a fixed seed so the first result will always be the same.
10
+ Unless you press ` r ` , other maps generated will follow a specific order,
11
+ the same every time. Pressing ` r ` will randomize and generate the next map.
12
+
13
+ ## Examples
14
+
15
+ ![ Example generated map] ( https://i.imgur.com/7Q1gYyl.png )
16
+
17
+ ![ Example generated map] ( https://i.imgur.com/KGtiV9V.png )
Original file line number Diff line number Diff line change 8
8
import com .badlogic .gdx .maps .tiled .TiledMapTileLayer ;
9
9
import com .badlogic .gdx .maps .tiled .TmxMapLoader ;
10
10
import com .badlogic .gdx .maps .tiled .renderers .OrthogonalTiledMapRenderer ;
11
+ import com .badlogic .gdx .utils .NumberUtils ;
11
12
import jagd .MimicWFC ;
12
13
import jagd .RNG ;
13
14
@@ -60,6 +61,13 @@ public boolean keyUp(int keycode) {
60
61
case Input .Keys .ESCAPE :
61
62
Gdx .app .exit ();
62
63
break ;
64
+ case Input .Keys .PRINT_SCREEN :
65
+ System .out .println ("Printing screen." );
66
+ break ;
67
+ case Input .Keys .R :
68
+ System .out .println ("Now using initial state " +
69
+ (rng .state = NumberUtils .doubleToLongBits (Math .random ()) ^ NumberUtils .doubleToLongBits (Math .random ()) >>> 32 ));
70
+ // FALLTHROUGH
63
71
default :
64
72
remake ();
65
73
renderer .setMap (tiledMap );
You can’t perform that action at this time.
0 commit comments