@benev/tact 0.4.0-4 → 0.4.0-5

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
@@ -70,7 +70,7 @@ i made tact because i want to make indie web game development easier. user input
70
70
  <tact-deck></tact-deck>
71
71
  ```
72
72
  - 💡 *you also have each panel, `<tact-controllers>` and `<tact-customize>`.*
73
- - 💡 *you can customize the colors with css:*
73
+ - 💡 *you can customize the colors with css.*
74
74
  ```html
75
75
  <style>
76
76
  html {
@@ -122,15 +122,15 @@ i made tact because i want to make indie web game development easier. user input
122
122
 
123
123
  const tact = await setupTact({presets, maxPlayers: 1})
124
124
  const controller = tact.mouseKeyboard()
125
- tact.registerElements()
126
-
127
125
  const decoder = new InputDecoder(bindings)
126
+ tact.registerElements()
128
127
 
129
128
  setInterval(() => {
130
129
  const inputs = decoder.decode(controller.encode())
131
130
 
132
- // here's where you do stuff with your inputs.
133
- input.jump.value
131
+ // 🧙‍♂️ handle your inputs.
132
+ inputs.jump.value
133
+
134
134
  }, 16.67)
135
135
  ```
136
136
  - 💡 *then the only ui you need is the `<tact-customize>` panel (also available as a sly view `CustomizeView`).*
@@ -138,15 +138,17 @@ i made tact because i want to make indie web game development easier. user input
138
138
  ```ts
139
139
  import {Controller, InputDecoder, KeyboardSource, PointerSource, Sources} from "@benev/tact"
140
140
 
141
- const controller = new Controller({
142
- bindings,
143
- source: new Sources(new KeyboardSource(), new PointerSource()),
144
- })
145
-
141
+ const source = new Sources(new KeyboardSource(), new PointerSource())
142
+ const controller = new Controller({bindings, source})
146
143
  const decoder = new InputDecoder(bindings)
147
144
 
148
- // call this in your gameloop.
149
- const inputs = decoder.decode(controller.encode())
145
+ setInterval(() => {
146
+ const inputs = decoder.decode(controller.encode())
147
+
148
+ // 🧙‍♂️ handle your inputs.
149
+ inputs.jump.value
150
+
151
+ }, 16.67)
150
152
  ```
151
153
 
152
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@benev/tact",
3
- "version": "0.4.0-4",
3
+ "version": "0.4.0-5",
4
4
  "description": "🎮 from keypress to couch co-op",
5
5
  "license": "MIT",
6
6
  "author": "Chase Moskal <chasemoskal@gmail.com>",
@@ -26,7 +26,7 @@
26
26
  <header>
27
27
  <h1>
28
28
  <strong>@benev/tact gamepad</strong>
29
- <small>v0.4.0-4</small>
29
+ <small>v0.4.0-5</small>
30
30
  </h1>
31
31
  </header>
32
32
 
package/x/index.html CHANGED
@@ -27,7 +27,7 @@
27
27
  <div>
28
28
  <h1>
29
29
  <strong>@benev/tact</strong>
30
- <small>v0.4.0-4</small>
30
+ <small>v0.4.0-5</small>
31
31
  </h1>
32
32
  <div>
33
33
  <blockquote>"from keypress to couch co-op"</blockquote>