-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkeith.js
78 lines (69 loc) · 2.27 KB
/
keith.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// keith's test file
// * below tests out the equipping and unequipping of weapons and armor
// * just uncomment and run locally. view information in the console logs
// import Player from "./js/classes/player.js";
// import {enterNewRoom} from "./js/classes/enterRoom.js";
// import { itemTypes, generateItem } from "./js/classes/generateItem.js";
// import { effectTypes } from "./js/classes/generateEffect.js";
// import generateEnemy from "./js/classes/generateEnemy.js";
// new Player("Keith", {hp: 100, atk: 3, spd: 2, def: 0});
// window.dagger = generateItem({ type: itemTypes.weapon, items: [
// {
// name: "Basic Sword",
// hands: 1,
// weight: 5,
// stats: {
// atk: 5,
// spd: 2,
// },
// },
// ] },);
// window.health = generateItem({ type: itemTypes.potion, items: [
// {
// name: "Minor Health Vial",
// weight: 8,
// effects: [
// {
// name: "Heal",
// type: effectTypes.regenerate,
// interval: 1000,
// duration: 5000,
// action: (subject) => {
// subject.heal(2);
// },
// }
// ],
// },
// ] },);
// window.enemy = generateEnemy(true);
//EnterRoom(p);
// import FSM from "./js/utils/fsm.js";
// let fsm = new FSM({
// init: 'locked',
// transitions: [
// { name: "unlock", from: 'locked', to: 'closed' },
// { name: "open", from: 'closed', to: 'opened' },
// ],
// callbacks: {
// onunlock: ({name, from, to, msg, num}) => {
// console.log(`Changed state from:${from} to:${to}`)
// console.log(msg, num)
// }
// }
// })
// console.log("Am I locked?",fsm.is('locked'))
// console.log("Am I opened?", fsm.is('opened'))
// console.log("Can I unlock?", fsm.can('unlock'))
// fsm.unlock({msg:"Unlocked", num: 25})
// console.log("Am I closed?", fsm.is('closed'))
// console.log("Can I unlock?", fsm.can('unlock'))
import "./js/components/action-button.js";
import "./js/components/info-panel.js";
import "./js/components/touch-icon.js";
import "./js/components/player-menu.js";
import "./js/components/health-bar.js";
import "./js/utils/ui.js";
import Player from "./js/classes/player.js";
import {enterNewRoom} from "./js/classes/enterRoom.js";
let p = Player("Sir Rad-Cool III", {hp: 100, atk: 5, spd: 80, def: 0});
enterNewRoom(p);