mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Play the game by default
This commit is contained in:
parent
361060da6a
commit
baab2582b5
|
@ -3,34 +3,27 @@ import { Mgba } from "./mgba";
|
||||||
import { BindingsControl, DefaultBindingsSet } from "./bindings";
|
import { BindingsControl, DefaultBindingsSet } from "./bindings";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [onGame, setOnGame] = useState(false);
|
|
||||||
const [volume, setVolume] = useState(1.0);
|
const [volume, setVolume] = useState(1.0);
|
||||||
const [bindings, setBindings] = useState(DefaultBindingsSet());
|
const [bindings, setBindings] = useState(DefaultBindingsSet());
|
||||||
const [paused, setPaused] = useState(false);
|
const [paused, setPaused] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{onGame && (
|
<Mgba
|
||||||
<>
|
gameUrl="/game.gba"
|
||||||
<Mgba
|
volume={volume}
|
||||||
gameUrl="/game.gba"
|
controls={bindings.Actual}
|
||||||
volume={volume}
|
paused={paused}
|
||||||
controls={bindings.Actual}
|
/>
|
||||||
paused={paused}
|
<input
|
||||||
/>
|
type="range"
|
||||||
<input
|
value={volume}
|
||||||
type="range"
|
min="0"
|
||||||
value={volume}
|
max="1"
|
||||||
min="0"
|
step="0.05"
|
||||||
max="1"
|
onChange={(e) => setVolume(Number(e.target.value))}
|
||||||
step="0.05"
|
></input>
|
||||||
onChange={(e) => setVolume(Number(e.target.value))}
|
|
||||||
></input>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<button onClick={() => setOnGame(!onGame)}>
|
|
||||||
{onGame ? "End Game" : "Start Game"}
|
|
||||||
</button>
|
|
||||||
<BindingsControl
|
<BindingsControl
|
||||||
bindings={bindings}
|
bindings={bindings}
|
||||||
setBindings={setBindings}
|
setBindings={setBindings}
|
||||||
|
|
Loading…
Reference in a new issue