summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-04-12 21:46:21 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-04-12 21:46:21 -0700
commitb6e617dff1e712aac10888a2781484eeb2e99e89 (patch)
tree414adc72d4dacdc28ed38e928c0642ae5a3b6569
parentc222109441b7cd779cbf3b440a4f3fdb45918965 (diff)
downloadstallman-shooter-main.tar.zst
Bump depsHEADmain
-rw-r--r--Cargo.lock18
-rw-r--r--Cargo.toml5
-rw-r--r--flake.lock10
-rw-r--r--flake.nix1
-rw-r--r--src/gates.rs3
-rw-r--r--src/state.rs5
6 files changed, 17 insertions, 25 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e296d32..24b16fb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "bitflags"
@@ -16,21 +16,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "lazy_static"
-version = "1.4.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
-version = "0.2.147"
+version = "0.2.171"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
+checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
[[package]]
name = "sdl2"
-version = "0.35.2"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7959277b623f1fb9e04aea73686c3ca52f01b2145f8ea16f4ff30d8b7623b1a"
+checksum = "3b498da7d14d1ad6c839729bd4ad6fc11d90a57583605f3b4df2cd709a9cd380"
dependencies = [
"bitflags",
"lazy_static",
@@ -40,9 +40,9 @@ dependencies = [
[[package]]
name = "sdl2-sys"
-version = "0.35.2"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3586be2cf6c0a8099a79a12b4084357aa9b3e0b0d7980e3b67aaf7a9d55f9f0"
+checksum = "951deab27af08ed9c6068b7b0d05a93c91f0a8eb16b6b816a5e73452a43521d3"
dependencies = [
"cfg-if",
"libc",
diff --git a/Cargo.toml b/Cargo.toml
index 68cd630..3b1ac19 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,13 +2,14 @@
name = "stallman-shooter"
version = "1.0.0"
authors = ["Rose Hogenson <rosehogenson@posteo.net>"]
+edition = "2024"
[dependencies.sdl2]
-version = "0.35.2"
+version = "0.37"
default-features = false
features = ["image"]
[dependencies.sdl2-sys]
-version = "0.35.2"
+version = "0.37"
default-features = false
features = ["image"]
diff --git a/flake.lock b/flake.lock
index 7d1d4c0..6297e3b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,12 +2,10 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1689935543,
- "narHash": "sha256-6GQ9ib4dA/r1leC5VUpsBo0BmDvNxLjKrX1iyL+h8mc=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "e43e2448161c0a2c4928abec4e16eae1516571bc",
- "type": "github"
+ "lastModified": 0,
+ "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
+ "path": "/nix/store/zd0x43g1jcav0xy0k6q9pdhy3bvif77n-source",
+ "type": "path"
},
"original": {
"id": "nixpkgs",
diff --git a/flake.nix b/flake.nix
index 0878b1d..81b91ed 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,6 +17,7 @@
nativeBuildInputs = with pkgs; [
clippy
+ rust-analyzer
];
buildInputs = with pkgs; [
diff --git a/src/gates.rs b/src/gates.rs
index 7f6bd9f..2451daa 100644
--- a/src/gates.rs
+++ b/src/gates.rs
@@ -194,9 +194,6 @@ impl state::Enemy<GatesBullet> for Gates {
fn health(&self) -> f64 {
self.health
}
- fn set_health(&mut self, health: f64) {
- self.health = health;
- }
fn injure(&mut self, damage: f64) {
self.health -= damage;
}
diff --git a/src/state.rs b/src/state.rs
index be89d3d..2a82294 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -76,7 +76,6 @@ pub trait Enemy<T>: Drawable {
fn new() -> Self;
fn act(&mut self, count: u64) -> Vec<T>;
fn health(&self) -> f64;
- fn set_health(&mut self, health: f64);
fn injure(&mut self, damage: f64);
}
@@ -110,10 +109,6 @@ pub trait Positioned {
fn x(&self) -> i32;
fn y(&self) -> i32;
fn radius() -> i32;
- fn contains(&self, x: i32, y: i32) -> bool {
- let d = dist(self.x(), self.y(), x, y);
- d <= Self::radius() as f64
- }
fn overlaps<T: Positioned>(&self, other: &T) -> bool {
let sx = self.x();
let ox = other.x();