浏览代码

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

tags/v0.2.8
Fen Dweller 7 年前
父节点
当前提交
1cbf05e3ee
共有 5 个文件被更改,包括 37 次插入1 次删除
  1. +19
    -0
      feast.css
  2. +6
    -1
      feast.html
  3. +11
    -0
      feast.js
  4. 二进制
      feast.png
  5. +1
    -0
      world.js

+ 19
- 0
feast.css 查看文件

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

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

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

#stats {
float: right;
}

+ 6
- 1
feast.html 查看文件

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

<body>

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

</div>

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

+ 11
- 0
feast.js 查看文件

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

@@ -21,6 +23,15 @@ window.addEventListener('load', function(event) {
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() {
document.getElementById("compass-north-west").addEventListener("click", function() {
move(NORTH_WEST);


二进制
feast.png 查看文件

之前 之后
宽度: 400  |  高度: 400  |  大小: 6.3 KiB

+ 1
- 0
world.js 查看文件

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

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



正在加载...
取消
保存