-
Notifications
You must be signed in to change notification settings - Fork 0
/
zspike.js
52 lines (39 loc) · 1.16 KB
/
zspike.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//FUNCTIONS IN OBJECTS WITH STATE EXPERIMENTATION
//~ let state_object = {
//~ "state_1": {
//~ actionable: "action_1",
//~ acted_on: [],
//~ interactable: function() {
//~ let acted = state_object["state_1"].acted_on
//~ acted.push(state_object["state_1"].actionable)
//~ }
//~ }
//~ }
//~ function test() {
//~ let acted = state_object["state_1"].acted_on
//~ acted.push(state_object["state_1"].actionable)
//~ }
//~ test()
//~ state_object["state_1"].interactable();
//~ console.log(state_object["state_1"].acted_on[0] + " I think I did it?")
// CLASS EXPERIMENTATION & OBJECT GENERATION
class Room {
constructor(actionable, acted_on, interactable) {
this.actionable = actionable;
this.acted_on = acted_on;
this.interactable = interactable;
}
}
Room.prototype.action = function() {
console.log("you have " + this.acted_on)
}
//~ const newRoom = new Room("chaair", "sitted on tha thing", "ayup, u cans sit")
//~ console.log(newRoom)
//~ newRoom.action()
var o = new Object();
o.test = "testing"
let newestRoom = new Room(o, 282, "hurpadurp")
console.log(newestRoom)
newestRoom.actionable.test = "other"
console.log(newestRoom)
newestRoom.action()