Browse Source

Switch to a universal resource directory and a nicer spritesheet

Getty Ritter 4 years ago
parent
commit
ab3bffcbaa

BIN
ch1/resources/terminal8x8.jpg


+ 2 - 1
ch1/src/main.rs

@@ -7,10 +7,11 @@ fn main() -> Result<(), GameError> {
         .resource_path({
             let base = std::env::var("CARGO_MANIFEST_DIR").unwrap();
             let mut path = std::path::PathBuf::from(base);
+            path.pop();
             path.push("resources");
             path
         })
-        .tileset("/terminal8x8.jpg", [8, 8])
+        .tileset("/haberdash.gif", [12, 12])
         .map_size(80, 50)
         .build()?;
     game.world.print([1, 1], "Hello, world!");

BIN
ch2/resources/terminal8x8.jpg


+ 2 - 1
ch2/src/main.rs

@@ -89,10 +89,11 @@ fn main() -> Result<(), GameError> {
         .resource_path({
             let base = std::env::var("CARGO_MANIFEST_DIR").unwrap();
             let mut path = std::path::PathBuf::from(base);
+            path.pop();
             path.push("resources");
             path
         })
-        .tileset("/terminal8x8.jpg", [8, 8])
+        .tileset("/haberdash.gif", [12, 12])
         .map_size(80, 50)
         .build()?;
 

BIN
ch3/resources/terminal8x8.jpg


+ 2 - 1
ch3/src/main.rs

@@ -123,10 +123,11 @@ fn main() -> Result<(), GameError> {
         .resource_path({
             let base = std::env::var("CARGO_MANIFEST_DIR").unwrap();
             let mut path = std::path::PathBuf::from(base);
+            path.pop();
             path.push("resources");
             path
         })
-        .tileset("/terminal8x8.jpg", [8, 8])
+        .tileset("/haberdash.gif", [12, 12])
         .map_size(80, 50)
         .build()?;
 

BIN
resources/haberdash.gif