Quellcode durchsuchen

The site now looks like a pile of crap. Also, icon!

tags/v0.2.8
Fen Dweller vor 7 Jahren
Ursprung
Commit
1cbf05e3ee
5 geänderte Dateien mit 37 neuen und 1 gelöschten Zeilen
  1. +19
    -0
      feast.css
  2. +6
    -1
      feast.html
  3. +11
    -0
      feast.js
  4. BIN
      feast.png
  5. +1
    -0
      world.js

+ 19
- 0
feast.css Datei anzeigen

@@ -1,4 +1,23 @@
body {
background: #111;
color: #eee;
}

button {
background: #222;
color: #eee;
}
.compass-button { .compass-button {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }

#log {
background: #222;
width: 500px;
height: 700px;
}

#stats {
float: right;
}

+ 6
- 1
feast.html Datei anzeigen

@@ -17,7 +17,11 @@


<body> <body>


<div id="location">
<div id="stats">
potato vore
</div>
<div id="log">


</div> </div>


@@ -33,3 +37,4 @@
<button class="compass-button" id="compass-south-east">South East</button> <button class="compass-button" id="compass-south-east">South East</button>
</div> </div>
</body> </body>
</html>

+ 11
- 0
feast.js Datei anzeigen

@@ -10,6 +10,8 @@ function move(direction) {
alert("Tried to move to an empty room!"); alert("Tried to move to an empty room!");
return; return;
} else { } else {
currentRoom = target;
update(["You move to " + currentRoom.name]);
updateDisplay(); updateDisplay();
} }


@@ -21,6 +23,15 @@ window.addEventListener('load', function(event) {
updateDisplay(); updateDisplay();
}); });


function update(lines=[]) {
let log = document.getElementById("log");
for (let i=0; i<lines.length; i++) {
let div = document.createElement("div");
div.innerHTML = lines[i];
log.appendChild(div);
}
}

function loadCompass() { function loadCompass() {
document.getElementById("compass-north-west").addEventListener("click", function() { document.getElementById("compass-north-west").addEventListener("click", function() {
move(NORTH_WEST); move(NORTH_WEST);


BIN
feast.png Datei anzeigen

Vorher Nachher
Breite: 400  |  Höhe: 400  |  Größe: 6.3 KiB

+ 1
- 0
world.js Datei anzeigen

@@ -14,6 +14,7 @@ let NORTH_WEST = 7;


function Location(name="Nowhere") { function Location(name="Nowhere") {
this.name = name; this.name = name;
this.description = "Not much of anything, really.";
this.exits = [null,null,null,null,null,null,null,null]; this.exits = [null,null,null,null,null,null,null,null];
} }




Laden…
Abbrechen
Speichern