summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2021-03-19 19:49:08 +0100
committerTom Barrett <tom@tombarrett.xyz>2021-03-19 19:49:08 +0100
commit07eb2dc0cbeaa7eb64645a86bd11842717a107a6 (patch)
treec564ef23faf051f4ff8d9c60a601e4a20728b71e
parent91a902278617f4981372b0f93612a7bfe902bc9b (diff)
added background
-rw-r--r--resources/background.pngbin332251 -> 3910 bytes
-rw-r--r--src/cosmonaut.rs2
-rw-r--r--src/game.rs8
3 files changed, 7 insertions, 3 deletions
diff --git a/resources/background.png b/resources/background.png
index 6ad2950..060989b 100644
--- a/resources/background.png
+++ b/resources/background.png
Binary files differ
diff --git a/src/cosmonaut.rs b/src/cosmonaut.rs
index 235861e..90a7c07 100644
--- a/src/cosmonaut.rs
+++ b/src/cosmonaut.rs
@@ -40,7 +40,7 @@ impl Cosmonaut {
Ok(Cosmonaut {
image,
- destination: Point2 { x: 600.0, y: 200.0 },
+ destination: Point2 { x: 600.0, y: 350.0 },
frame: CosmonautFrames::None,
timer: Instant::now(),
scale: Vector2 {
diff --git a/src/game.rs b/src/game.rs
index 5b72d9d..d2b88e8 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -1,7 +1,7 @@
use ggez::event::EventHandler;
use ggez::graphics::{self, spritebatch::SpriteBatch, DrawParam, FilterMode, Image, WrapMode};
use ggez::input::mouse;
-use ggez::mint::Point2;
+use ggez::mint::{Point2, Vector2};
use ggez::{Context, GameResult};
use std::time::Instant;
@@ -252,7 +252,11 @@ impl EventHandler for Game {
fn draw(&mut self, context: &mut Context) -> GameResult {
graphics::clear(context, [0.0, 0.0, 0.0, 1.0].into());
- graphics::draw(context, &self.background, DrawParam::default())?;
+ graphics::draw(
+ context,
+ &self.background,
+ DrawParam::default().scale(Vector2 { x: 3.35, y: 3.35 }),
+ )?;
self.cosmonaut.draw(context)?;
for row in self.grid.iter() {