-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split stats & inventory screen for better mobile experience
- Loading branch information
Showing
11 changed files
with
96 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script lang="ts"> | ||
import { noop } from '$lib/helpers'; | ||
import { player } from '$stores/player'; | ||
import type { BaseStatsName } from '../..'; | ||
$: baseStats = $player.getBaseStats(); | ||
$: stats = $player.getStats(); | ||
const addBaseStats = (baseStatsName : BaseStatsName) => () => { | ||
player.update((player) => { | ||
player.baseStats[baseStatsName]++; | ||
player.freeBaseStatsPoint--; | ||
return player; | ||
}); | ||
} | ||
</script> | ||
|
||
<div class="menu text-white"> | ||
<div class="text-3xl">Stats</div> | ||
|
||
<div class="grid grid-cols-2 text-2xl"> | ||
<div class="pl-5"> | ||
Level : {$player.level} <br /> | ||
XP : {$player.xp} / {$player.getNeededXp()} <br /> | ||
</div> | ||
<div class="pl-5"> | ||
Strength : {baseStats.strength} {#if $player.freeBaseStatsPoint > 0} | ||
<span on:click={addBaseStats('strength')} on:keypress={noop}>+</span> | ||
{/if}<br /> | ||
Dexterity : {baseStats.dexterity} {#if $player.freeBaseStatsPoint > 0} | ||
<span on:click={addBaseStats('dexterity')} on:keypress={noop}>+</span> | ||
{/if}<br /> | ||
Wisdom : {baseStats.wisdom} {#if $player.freeBaseStatsPoint > 0} | ||
<span on:click={addBaseStats('wisdom')} on:keypress={noop}>+</span> | ||
{/if}<br /> | ||
</div> | ||
<div class="pl-5 mt-5"> | ||
AC : {stats.ac} <br /> | ||
Hit : {stats.hit} <br /> | ||
HP : {stats.hp} <br /> | ||
</div> | ||
<div class="pl-5 mt-5"> | ||
Attack : {stats.pAttack} <br /> | ||
Defense : {stats.pDefense} <br /> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters