Compare commits
2 Commits
7a3e8fac3c
...
3ad5811566
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ad5811566 | ||
|
|
a8a0f54cb7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
Test
|
|
||||||
31
README.md
31
README.md
@@ -1,23 +1,20 @@
|
|||||||
Règles :
|
règles :
|
||||||
Un rayon laser constant
|
un rayon laser constant
|
||||||
Un ou plusieurs laser
|
un ou plusieurs spawn
|
||||||
Laser non movibles, on/off
|
laser non movibles, on/off
|
||||||
Mirroirs orientables
|
mirroirs orientables
|
||||||
Prisme (dédouble le laser ou le renvoi selon l'angle)
|
prisme
|
||||||
Vitre colorée fixe ou placable par le joueur (r,j,b)
|
vitre colorée (rjb)
|
||||||
Bouton allumable par clique souris (interaction porte, mirroir, etc)
|
bouton allumable par laser spécifique (interaction porte, mirroir, etc)
|
||||||
Bouton allumable par laser spécifique (interaction porte, mirroir, etc)
|
|
||||||
|
|
||||||
|
|
||||||
Rayon :
|
rayon :
|
||||||
Blanc -> rebondis seulement sur les mirroirs et s'arrête contre les murs
|
rouge - allumage bouton
|
||||||
Rouge -> Allumage boutons
|
bleu - base
|
||||||
Bleu -> Rebondis sur toutes les surfaces
|
jaune - traverse tout
|
||||||
Jaune -> Traverse tout (mirroir compris)
|
|
||||||
|
|
||||||
|
|
||||||
Systeme de placement d'objet par grille
|
systeme de placement d'objet par grille
|
||||||
|
|
||||||
Comptes utilisateur
|
|
||||||
|
|
||||||
Optionnel : timer, tableau de score,
|
optionnel : timer, tableau de score,
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
use axum::{Router, response::Html, routing::get};
|
use axum::{routing::get, Router};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::path::Path;
|
|
||||||
use tokio::fs::File;
|
|
||||||
use tokio::io::{self, AsyncReadExt};
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let app = Router::new().route("/", get(handler));
|
let app = Router::new().route("/", get(|| async { "Hello, world!" }));
|
||||||
|
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||||
println!("listening on {}", addr);
|
println!("listening on {}", addr);
|
||||||
@@ -15,17 +12,3 @@ async fn main() {
|
|||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handler() -> Html<String> {
|
|
||||||
let html_content = read_html_from_file("../web/templates/view/index.html")
|
|
||||||
.await
|
|
||||||
.unwrap_or_else(|_| "<h1>Error loading HTML file</h1>".to_string());
|
|
||||||
Html(html_content)
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn read_html_from_file<P: AsRef<Path>>(path: P) -> io::Result<String> {
|
|
||||||
let mut file = File::open(path).await?;
|
|
||||||
let mut contents = String::new();
|
|
||||||
file.read_to_string(&mut contents).await?;
|
|
||||||
Ok(contents)
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user