@benev/tact 0.4.0-2 → 0.4.0-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -107,8 +107,8 @@ i made tact because i want to make indie web game development easier. user input
107
107
  }
108
108
  }, 16.67)
109
109
  ```
110
- 💡 *you could stream the buffers across the network to a remote collector.*
111
- 💡 *maybe imagine having the tact deck on the clientside, and the collector on the serverside (or a web worker!).*
110
+ - 💡 *you could stream the buffers across the network to a remote collector.*
111
+ - 💡 *maybe imagine having the tact deck on the clientside, and the collector on the serverside (or a web worker!).*
112
112
 
113
113
 
114
114
 
@@ -116,7 +116,25 @@ i made tact because i want to make indie web game development easier. user input
116
116
 
117
117
  ## 🎮 get down to brass tacks.
118
118
 
119
- - 🍏 **use the core facilities directly,** without the ui or multiplayer.
119
+ - 🍏 **pov: your app isn't a game, no multiplayer, no gamepads.**
120
+ ```ts
121
+ import {setupTact, InputDecoder} from "@benev/tact"
122
+
123
+ const tact = await setupTact({presets, maxPlayers: 1})
124
+ const controller = tact.mouseKeyboard()
125
+ tact.registerElements()
126
+
127
+ const decoder = new InputDecoder(bindings)
128
+
129
+ setInterval(() => {
130
+ const inputs = decoder.decode(controller.encode())
131
+
132
+ // here's where you do stuff with your inputs.
133
+ input.jump.value
134
+ }, 16.67)
135
+ ```
136
+ - 💡 *then the only ui you need is the `<tact-customize>` panel (also available as a sly view `CustomizeView`).*
137
+ - 🍏 **pov: your app doesn't even want any ui, or persistence.**
120
138
  ```ts
121
139
  import {Controller, InputDecoder, KeyboardSource, PointerSource, Sources} from "@benev/tact"
122
140
 
@@ -127,7 +145,7 @@ i made tact because i want to make indie web game development easier. user input
127
145
 
128
146
  const decoder = new InputDecoder(bindings)
129
147
 
130
- // call this in your gameloop:
148
+ // call this in your gameloop.
131
149
  const inputs = decoder.decode(controller.encode())
132
150
  ```
133
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benev/tact",
3
- "version": "0.4.0-2",
3
+ "version": "0.4.0-4",
4
4
  "description": "🎮 from keypress to couch co-op",
5
5
  "license": "MIT",
6
6
  "author": "Chase Moskal <chasemoskal@gmail.com>",
package/s/demo/main.css CHANGED
@@ -74,6 +74,7 @@
74
74
  display: flex;
75
75
  flex-wrap: wrap;
76
76
  justify-content: space-between;
77
+ align-items: end;
77
78
  gap: 1em;
78
79
  padding: 0 2em;
79
80
 
package/x/demo/main.css CHANGED
@@ -74,6 +74,7 @@
74
74
  display: flex;
75
75
  flex-wrap: wrap;
76
76
  justify-content: space-between;
77
+ align-items: end;
77
78
  gap: 1em;
78
79
  padding: 0 2em;
79
80
 
@@ -26,7 +26,7 @@
26
26
  <header>
27
27
  <h1>
28
28
  <strong>@benev/tact gamepad</strong>
29
- <small>v0.4.0-2</small>
29
+ <small>v0.4.0-4</small>
30
30
  </h1>
31
31
  </header>
32
32
 
package/x/index.html CHANGED
@@ -9,7 +9,7 @@
9
9
  <style>@layer base{html{background:#111}}</style>
10
10
 
11
11
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>🎮</text></svg>"/>
12
- <link rel="stylesheet" href="demo/main.css?v=c6f811926e58"/>
12
+ <link rel="stylesheet" href="demo/main.css?v=1f568a399ed6"/>
13
13
  <script type="module" src="demo/main.bundle.min.js?v=5848b3a37824"></script>
14
14
 
15
15
 
@@ -27,7 +27,7 @@
27
27
  <div>
28
28
  <h1>
29
29
  <strong>@benev/tact</strong>
30
- <small>v0.4.0-2</small>
30
+ <small>v0.4.0-4</small>
31
31
  </h1>
32
32
  <div>
33
33
  <blockquote>"from keypress to couch co-op"</blockquote>