Skip to content

Commit

Permalink
removed all dependencies, added some kind of gameplay
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Mar 27, 2024
1 parent 58ea8c9 commit 6db82f6
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 141 deletions.
60 changes: 0 additions & 60 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rand = { version = "0.8.5", features = ["small_rng"], default-features = false }
talc = { version = "4.3.1", default-features = false, features = ["lock_api", "counters"] }
spin = "0.9.8"


[lib]
crate-type = ["cdylib"]


[profile.release]
strip = true
lto = true
Expand Down
Binary file modified docs/blockwars.wasm
Binary file not shown.
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
i = new ImageData(new Uint8ClampedArray(a.exports.memory.buffer, b, 4 * w * w), w),
d = c.getContext("2d"),
r = () => {
a.exports.go();
const game_loop = a.exports.game_loop();
console.log(game_loop);
movePlayer();
d.putImageData(i, 0, 0);
requestAnimationFrame(r);
};
r();

a.exports.main();
a.exports.spawn_enemies();

var keysPressed = {
ArrowLeft: false,
Expand Down
Loading

0 comments on commit 6db82f6

Please sign in to comment.