package updates and fixed surrounding detection
* also a nicer running animation
9
.editorconfig
Normal file
|
@ -0,0 +1,9 @@
|
|||
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
end_of_line = lf
|
||||
max_line_length = 100
|
1
.gitattributes
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
* text=auto eol=lf
|
30
.gitignore
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
6
.prettierrc.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100
|
||||
}
|
9
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"Vue.volar",
|
||||
"vitest.explorer",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
45
README.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
# vue-shovel
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
||||
|
||||
```sh
|
||||
pnpm test:unit
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
pnpm lint
|
||||
```
|
1
env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference types="vite/client" />
|
32
eslint.config.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import pluginVue from 'eslint-plugin-vue'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import pluginVitest from '@vitest/eslint-plugin'
|
||||
import oxlint from 'eslint-plugin-oxlint'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||
|
||||
export default defineConfigWithVueTs(
|
||||
{
|
||||
name: 'app/files-to-lint',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
|
||||
{
|
||||
name: 'app/files-to-ignore',
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
|
||||
},
|
||||
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
|
||||
{
|
||||
...pluginVitest.configs.recommended,
|
||||
files: ['src/**/__tests__/*'],
|
||||
},
|
||||
...oxlint.configs['flat/recommended'],
|
||||
skipFormatting,
|
||||
)
|
88
index.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/dirt.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/dirt_grass.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/gravel_dirt.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/gravel_stone.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/stone.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/stone_dirt.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/sand.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/stone_sand.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/stone_grass.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/trunk_mid.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/trunk_bottom.png" />
|
||||
<link rel="preload" as="image" href="/Tiles/leaves_transparent.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vue Shovel</title>
|
||||
<style>
|
||||
:root {
|
||||
--block-size: 64px;
|
||||
--blocks-x: 20;
|
||||
--blocks-y: 12;
|
||||
--spare-blocks: 2;
|
||||
--field-width: calc(var(--block-size) * var(--blocks-x));
|
||||
--field-height: calc(var(--block-size) * var(--blocks-y));
|
||||
}
|
||||
html,body,#app {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
#field {
|
||||
position: relative;
|
||||
width: var(--field-width);
|
||||
height: var(--field-height);
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
background-color: #56F;
|
||||
}
|
||||
#input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
#level-indicator {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
color: white;
|
||||
}
|
||||
.screen {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: calc(100% - 2em);
|
||||
padding: 1em;
|
||||
background: transparent;
|
||||
color: white;
|
||||
backdrop-filter: blur(5px) sepia(.8) brightness(0.4);
|
||||
}
|
||||
h2 {
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
p {
|
||||
line-height: 2;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
55
package.json
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"name": "vue-shovel",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"test:unit": "vitest",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build",
|
||||
"lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
|
||||
"lint:eslint": "eslint . --fix",
|
||||
"lint": "run-s lint:*",
|
||||
"format": "prettier --write src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"alea": "^1.0.1",
|
||||
"simplex-noise": "^4.0.3",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node22": "^22.0.0",
|
||||
"@types/jsdom": "^21.1.7",
|
||||
"@types/node": "^22.13.9",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitest/eslint-plugin": "^1.1.36",
|
||||
"@vue/eslint-config-prettier": "^10.2.0",
|
||||
"@vue/eslint-config-typescript": "^14.5.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-plugin-oxlint": "^0.15.13",
|
||||
"eslint-plugin-vue": "~10.0.0",
|
||||
"jiti": "^2.4.2",
|
||||
"jsdom": "^26.0.0",
|
||||
"npm-run-all2": "^7.0.2",
|
||||
"oxlint": "^0.15.13",
|
||||
"prettier": "3.5.3",
|
||||
"typescript": "~5.8.0",
|
||||
"vite": "^6.2.1",
|
||||
"vite-plugin-vue-devtools": "^7.7.2",
|
||||
"vitest": "^3.0.8",
|
||||
"vue-tsc": "^2.2.8"
|
||||
},
|
||||
"pnpm": {
|
||||
"ignoredBuiltDependencies": [
|
||||
"esbuild"
|
||||
],
|
||||
"onlyBuiltDependencies": [
|
||||
"esbuild"
|
||||
]
|
||||
}
|
||||
}
|
4232
pnpm-lock.yaml
generated
Normal file
BIN
public/Characters/Alien/alien_arm.png
Normal file
After Width: | Height: | Size: 169 B |
BIN
public/Characters/Alien/alien_body.png
Normal file
After Width: | Height: | Size: 186 B |
BIN
public/Characters/Alien/alien_head.png
Normal file
After Width: | Height: | Size: 491 B |
BIN
public/Characters/Alien/alien_leg.png
Normal file
After Width: | Height: | Size: 168 B |
BIN
public/Characters/Boar/boar_body.png
Normal file
After Width: | Height: | Size: 920 B |
BIN
public/Characters/Boar/boar_head.png
Normal file
After Width: | Height: | Size: 611 B |
BIN
public/Characters/Boar/boar_leg.png
Normal file
After Width: | Height: | Size: 213 B |
BIN
public/Characters/Boar/boar_tail.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
public/Characters/Fox/fox_body.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
public/Characters/Fox/fox_ear.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
public/Characters/Fox/fox_leg.png
Normal file
After Width: | Height: | Size: 165 B |
BIN
public/Characters/Fox/fox_tail.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
public/Characters/Gnome/gnome_arm.png
Normal file
After Width: | Height: | Size: 174 B |
BIN
public/Characters/Gnome/gnome_body.png
Normal file
After Width: | Height: | Size: 192 B |
BIN
public/Characters/Gnome/gnome_head.png
Normal file
After Width: | Height: | Size: 864 B |
BIN
public/Characters/Gnome/gnome_leg.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
public/Characters/Hedgehog/hedgehog_body.png
Normal file
After Width: | Height: | Size: 432 B |
BIN
public/Characters/Player1/female_arm.png
Normal file
After Width: | Height: | Size: 198 B |
BIN
public/Characters/Player1/female_body.png
Normal file
After Width: | Height: | Size: 194 B |
BIN
public/Characters/Player1/female_head.png
Normal file
After Width: | Height: | Size: 553 B |
BIN
public/Characters/Player1/female_leg.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
public/Characters/Player2/male_arm.png
Normal file
After Width: | Height: | Size: 200 B |
BIN
public/Characters/Player2/male_body.png
Normal file
After Width: | Height: | Size: 195 B |
BIN
public/Characters/Player2/male_head.png
Normal file
After Width: | Height: | Size: 433 B |
BIN
public/Characters/Player2/male_leg.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
public/Characters/Skeleton/skeleton_arm.png
Normal file
After Width: | Height: | Size: 241 B |
BIN
public/Characters/Skeleton/skeleton_body.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
public/Characters/Skeleton/skeleton_head.png
Normal file
After Width: | Height: | Size: 492 B |
BIN
public/Characters/Skeleton/skeleton_leg.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
public/Characters/Zombie/zombie_arm.png
Normal file
After Width: | Height: | Size: 305 B |
BIN
public/Characters/Zombie/zombie_body.png
Normal file
After Width: | Height: | Size: 195 B |
BIN
public/Characters/Zombie/zombie_head.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
public/Characters/Zombie/zombie_leg.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
public/Items/apple.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
public/Items/arrow.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
public/Items/axe_bronze.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/axe_diamond.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/axe_gold.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/axe_iron.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/axe_silver.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/boat.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
public/Items/bow.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/bowArrow.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
public/Items/bowl.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
public/Items/fish.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/fish_cooked.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
public/Items/fishingPole.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
public/Items/flail_bronze.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
public/Items/flail_diamond.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
public/Items/flail_gold.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
public/Items/flail_iron.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
public/Items/flail_silver.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
public/Items/hammer_bronze.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/hammer_diamond.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/hammer_gold.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/hammer_iron.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/hammer_silver.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/hoe_bronze.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/hoe_diamond.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/hoe_gold.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/hoe_iron.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/hoe_silver.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/minecart.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
public/Items/ore_coal.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
public/Items/ore_diamond.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
public/Items/ore_emerald.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
public/Items/ore_gold.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
public/Items/ore_iron.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
public/Items/ore_ironAlt.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
public/Items/ore_ruby.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
public/Items/ore_silver.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
public/Items/pick_bronze.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/pick_diamond.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/pick_gold.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/pick_iron.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/pick_silver.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
public/Items/seed.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
public/Items/shovel_bronze.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
public/Items/shovel_diamond.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/shovel_gold.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
public/Items/shovel_iron.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
public/Items/shovel_silver.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
public/Items/stew.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
public/Items/sword_bronze.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/sword_diamond.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/sword_gold.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/sword_iron.png
Normal file
After Width: | Height: | Size: 4 KiB |
BIN
public/Items/sword_silver.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
public/Items/wheat.png
Normal file
After Width: | Height: | Size: 4.8 KiB |