diff --git a/client/src/lib/3d/Scene.svelte b/client/src/lib/3d/Scene.svelte index 612e1fca..44116f4c 100644 --- a/client/src/lib/3d/Scene.svelte +++ b/client/src/lib/3d/Scene.svelte @@ -139,5 +139,4 @@ - \ No newline at end of file diff --git a/client/src/lib/3d/components/Cameras/BirdView.svelte b/client/src/lib/3d/components/Cameras/BirdView.svelte index d30fb10d..2871811f 100644 --- a/client/src/lib/3d/components/Cameras/BirdView.svelte +++ b/client/src/lib/3d/components/Cameras/BirdView.svelte @@ -2,6 +2,7 @@ import { T } from '@threlte/core' import { OrbitControls } from '@threlte/extras' import { useThrelte } from '@threlte/core' + import { Vector3 } from 'three' export let camera let {renderer} = useThrelte() @@ -9,9 +10,10 @@ { camera = ref + camera.lookAt(new Vector3(0, 4, 0)) }} > diff --git a/client/src/lib/controller.ts b/client/src/lib/controller.ts index eb30caaa..3889ba1e 100644 --- a/client/src/lib/controller.ts +++ b/client/src/lib/controller.ts @@ -3,10 +3,7 @@ import { account, username } from '$stores/account'; import { dojoStore } from '$src/stores/dojoStore'; import { get } from 'svelte/store'; -export const mapmakerContract = '0x11e7a657668ca83c556f7545ab5bde00c1a1275c6c9ed17bea33104fcda2f3b' -export const spawnContract = '0x57a72dd6f0bf3b0ced0fd50e54696643b8e3b38e226a150a1471c658355921e' -export const startContract = '0x44ce069fe53c5c7941eec521bc9e876907d5da6ca273a98b78f1cbbcfea5b62' -export const actionsContract = '0x11de1871e7fa8ac97e62c36724c32ee584982f4a5892b4f62fd545d7ab2d506' +export const actionsContract = "0x7a9e8de4cf849402d115efdae32b892235dddbf29e15dcde2222fbcd928a30c" export const planeteloContract = "0x52e3d09dd643e4d4f491b3d022d3c67f48c0bf2ceda8e7b3fc83f45d06711bd" export const controllerMainnet = new Controller({ @@ -31,6 +28,10 @@ export const controllerSepolia = new Controller({ { target: planeteloContract, method: "settle", + }, + { + target: actionsContract, + method: "move", } // ... other policies diff --git a/client/src/routes/+page.svelte b/client/src/routes/+page.svelte index c6aacac6..902a19d5 100644 --- a/client/src/routes/+page.svelte +++ b/client/src/routes/+page.svelte @@ -24,7 +24,7 @@ if (!$account) { await connect(config); } - goto(`${config}/client/games/openGames`); + goto(`${config}/client/matchmaking`); } onMount(() => { @@ -40,8 +40,6 @@ OCTOGUNS
- -
diff --git a/client/src/routes/[slug]/client/matchmaking/+page.svelte b/client/src/routes/[slug]/client/matchmaking/+page.svelte index 4e5464f4..03bb8c52 100644 --- a/client/src/routes/[slug]/client/matchmaking/+page.svelte +++ b/client/src/routes/[slug]/client/matchmaking/+page.svelte @@ -29,6 +29,7 @@ let {config, dojoProvider}: any = get(dojoStore); const actions = new Contract(config.manifest.contracts[4].abi, config.manifest.contracts[4].address, dojoProvider.provider).typedv2(config.manifest.contracts[4].abi); + console.log(actions) //@ts-ignore let name = "octoguns".toString(16); console.log(name) @@ -59,11 +60,11 @@ $: buttonText = status === 0 ? 'Queue' : status === 1 ? 'Matchmake' - : status === 2 && result == 1 ? 'Play' : 'Settle'; + : status === 2 && result == 0 ? 'Play' : 'Settle'; $: buttonClass = status === 0 ? '' : status === 1 ? 'queuing' - : status === 2 && result == 1 ? 'playing' : 'settle'; + : status === 2 && result == 0 ? 'playing' : 'settle'; async function handleSettle() { let res = await $account?.execute( @@ -88,7 +89,7 @@ queue_length = parseInt(await planetelo.get_queue_length(game_key, "0x0")); if (status == 2) { game_id = parseInt(await planetelo.get_player_game_id($account!.address, game_key, "0x0")); - let result = parseInt(await actions.get_result(game_id)); + result = parseInt(await actions.get_result(game_id)); console.log(result) } console.log(status) @@ -110,26 +111,36 @@ {#if $dojoStore} -
-
-

ELO: {elo}

-

Players in Queue: {queue_length}

-
- - {#if status === 1} -

Finding a match...

- {/if} +
+
+

ELO: {elo}

+

Players in Queue: {queue_length}

- {:else} -

Setting up...

- {/if} + + {#if status === 2} + {#if result === 0} +

In Game

+ {:else} +

Game Over

+ {/if} + {/if} + + + + {#if status === 1} +

Finding a match...

+ {/if} +
+{:else} +

Setting up...

+{/if} - + + .status { + font-size: 1.2rem; + color: #555; + } + + .status-message { + font-size: 1.2rem; + font-weight: 500; + margin-bottom: 1rem; + text-align: center; + } + \ No newline at end of file