Skip to content

Commit

Permalink
Bye sketch.js - Using wollok-game-web frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Jul 3, 2024
1 parent e2da7a0 commit aa96159
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 325 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint": "eslint . ",
"lint:fix": "eslint . --fix",
"test:unit": "mocha --parallel -r ts-node/register/transpile-only test/**/*.test.ts --timeout 7000",
"build": "shx rm -rf build && shx mkdir ./build && shx cp -r ./public ./build/public && tsc -p ./tsconfig.build.json",
"build": "shx rm -rf build && shx mkdir ./build && shx cp -r ./public ./build/public && cp ./node_modules/wollok-game-web/dist/web/index.js ./build/public/game/lib && tsc -p ./tsconfig.build.json",
"watch": "npm run build -- -w",
"pack": "pkg .",
"prepublishOnly": "npm run build && npm run test"
Expand Down
23 changes: 17 additions & 6 deletions public/game/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
<meta charset="UTF-8" />
<script src="./lib/p5.js"></script>
<script src="./lib/p5.sound.js"></script>
<script src="./lib/index.js"></script>
<title>Wollok Game</title>

<script
<!-- <script
language="javascript"
type="text/javascript"
src="./sketch.js"
></script>
></script> -->
<style>
main {
display: flex;
Expand All @@ -26,16 +27,26 @@
<script>
let socket = 1;
</script>
<main>
<div id="game" class="game"></div>
</main>
<script type="module">
import { io } from "./lib/socket.io.esm.min.js";

socket = io();
socket.on("connect", function () {
console.log("conectado!");
});
console.log("conectado!")
})
socket.on("disconnect", function () {
console.log("desconectado!");
});
console.log("desconectado!")
})

const parent = document.getElementById('game')
const game = new SocketGame(socket)

socket.on("start", function () {
game.start(parent)
})
</script>
</body>
</html>
273 changes: 0 additions & 273 deletions public/game/sketch.js

This file was deleted.

Loading

0 comments on commit aa96159

Please sign in to comment.