mozilla / mortar-game-stub Goto Github PK
View Code? Open in Web Editor NEWINACTIVE - http://mzl.la/ghe-archive - A simple web game template.
Home Page: http://mozilla.github.com/mortar-game-stub/
INACTIVE - http://mzl.la/ghe-archive - A simple web game template.
Home Page: http://mozilla.github.com/mortar-game-stub/
We solved the pause issue in #1, but if your phone lags (which I haven't witnessed but is entirely possible) you might still end up with a huge jump when the next animation frame comes around. I suggest we limit the maximum time delta to one second.
This is mostly meant for mobile development (for now). Let's add touch events on the canvas for moving the player around.
It doesn't make sense to "waste" space with the template title and description when running this on a small screen (e.g. in mobiles). In those cases we should make the canvas use all available screen space, and probably display the texts over the canvas itself (using white on black for obvious reasons). Should use media queries for text and positioning.
Or maybe we should even always use a full screen canvas in all the cases?
and resize accordingly
As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:
If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].
(Message COC001)
else this looks terrible in "retinas"
add one
so this is actually a "game" and we can show different stages or "screens" if need be
So when you "leave the tab" or close the app, requestAnimationFrame will stop triggering. However, due to the way we handle a steady average speed (by measureing time between each animation frame), there will be a huge jump in game play when you return to the app.
I suggest we detect leaving and coming back (blur event?? my memory is fuzzy) and reset the timestamp when we come back so we restart where we left off instead of jumping ahead.
That said, by exposing an "unpause" event (or so), we can leave it up to the developer to not start right back up when coming back but wait for keypress or something.
Basically add some more css so it doesn't look as unfinished as it does right now
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.