forked from karx/catbox
idea
This commit is contained in:
parent
9d2c2b2e2b
commit
7e056d0116
5
build.rs
5
build.rs
|
@ -1,4 +1,3 @@
|
|||
use native_tls;
|
||||
use std::env;
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{copy, BufWriter};
|
||||
|
@ -97,7 +96,7 @@ pub fn download_files(path: &Path,url: &str) -> Result<File, Box<dyn std::error:
|
|||
.split("; ")
|
||||
.find(|s| s.starts_with("filename="))
|
||||
.unwrap()
|
||||
.split("=")
|
||||
.split('=')
|
||||
.nth(1)
|
||||
.unwrap()
|
||||
.trim_matches('"');
|
||||
|
@ -105,7 +104,7 @@ pub fn download_files(path: &Path,url: &str) -> Result<File, Box<dyn std::error:
|
|||
// Create a new File object to store the downloaded zip file
|
||||
|
||||
let mut path = path.to_path_buf();
|
||||
path.push(&file_name);
|
||||
path.push(file_name);
|
||||
let file = OpenOptions::new()
|
||||
.read(true)
|
||||
.write(true)
|
||||
|
|
|
@ -747,8 +747,8 @@ impl Game {
|
|||
///}).unwrap();
|
||||
///```
|
||||
pub fn step(&self) -> u128 {
|
||||
let a = self.time.get().elapsed().as_millis().clone();
|
||||
a
|
||||
self.time.get().elapsed().as_millis()
|
||||
|
||||
}
|
||||
|
||||
///Resets in-game timer
|
||||
|
|
|
@ -24,11 +24,11 @@ fn main() {
|
|||
game.run(|ctx| {
|
||||
if game.step() >= 1 {
|
||||
i = (i + 1) % 255;
|
||||
ctx.set_background_colour(i as u8, 64, 255);
|
||||
ctx.set_background_colour(i, 64, 255);
|
||||
|
||||
draw_text(
|
||||
ctx,
|
||||
format!("i is {}", i),
|
||||
format!("i is {i}"),
|
||||
"MesloLGS NF Regular.ttf",
|
||||
72,
|
||||
(300, 300),
|
||||
|
@ -80,7 +80,7 @@ fn main() {
|
|||
}
|
||||
|
||||
if !cat_box::physics::check_for_collision_with_collection(&s2, &coll).is_empty() {
|
||||
println!("Sprites collided! {}", i);
|
||||
println!("Sprites collided! {i}");
|
||||
}
|
||||
|
||||
game.t_reset();
|
||||
|
|
Loading…
Reference in a new issue