tomassedovic / quicksilver-roguelike Goto Github PK
View Code? Open in Web Editor NEWTemplate for a roguelike in Rust targeting desktop and the web
License: MIT License
Template for a roguelike in Rust targeting desktop and the web
License: MIT License
cloned the repo then did: cargo web start --release --auto-reload
Then it built and said: You can access the web server at http://127.0.0.1:8000
But when I point chrome there I just get an empty white page.
The HTML:
| <!DOCTYPE html>
-- | --
| <html>
| <head><script>
| window.addEventListener( "load", function() {
| var current_build_hash = 2901363078;
| function try_reload() {
| var req = new XMLHttpRequest();
| req.addEventListener( "load" , function() {
| if( req.responseText != current_build_hash ) {
| window.location.reload( true );
| }
| });
| req.addEventListener( "loadend", function() {
| setTimeout( try_reload, 500 );
| });
| req.open( "GET", "/__cargo-web__/build_hash" );
| req.send();
| }
| try_reload();
| });
| </script>
| <meta charset="utf-8" />
| <meta http-equiv="X-UA-Compatible" content="IE=edge" />
| <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" name="viewport" />
| <script>
| var Module = {};
| var __cargo_web = {};
| Object.defineProperty( Module, 'canvas', {
| get: function() {
| if( __cargo_web.canvas ) {
| return __cargo_web.canvas;
| }
|
| var canvas = document.createElement( 'canvas' );
| document.querySelector( 'body' ).appendChild( canvas );
| __cargo_web.canvas = canvas;
|
| return canvas;
| }
| });
| </script>
| </head>
| <body>
| <script src="quicksilver-roguelike.js"></script>
| </body>
| </html>
When I click quicksilver-roguelike.js
in the view source display it loads the source so it seems like it find the code.
Quicksilver now has a prelude module:
https://docs.rs/quicksilver/0.3.10/quicksilver/prelude/index.html
That should simplify the use statements in the text nicely.
When serving the webassembly game, the compiled *.wasm
file must be served with the right content-type.
Github pages do this automatically, but not every other hosting / server does. Find out the right content type and mention it at the end of the document.
Do a git diff -w
of this fork:
Kinrany/quicksilver-roguelike@fd99006
It's got some issues that @Kinrany fixed:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.