
Stage is a minimalistic 2D, cross-platform HTML5 game engine - minxomat
http://piqnt.com/stage.js/
======
nikodunk
The performance in my mobile device feels super native.
[http://piqnt.com/4/four/](http://piqnt.com/4/four/)

~~~
travbrack
iPhone 11 and I'm getting what looks like 15-30 fps

~~~
speedgoose
Time to replace the battery?

~~~
travbrack
Oops, I was on low battery. Carry on. Nothing to see here.

~~~
jmull
Actually, thanks for coming back to post this.

I appreciate it because I'm interested in this kind of thing (not necessarily
just games, but graphical custom interfaces in general) and getting
confirmation on why it was slow (on powerful hardware) is good to know.

------
minxomat
The matching physics engine, Planck, can be found on the same website btw:
[http://piqnt.com/planck.js/](http://piqnt.com/planck.js/)

------
gibolt
The game with the little balls coming across from the sides is super simple,
and super creative with its limitations.

~~~
megablast
I have no idea what game you are talking about?

~~~
crummy
[http://piqnt.com/o/](http://piqnt.com/o/) I think

------
627467
I'm loving that this runs on a (end of lifed) blackberry passport browser. Not
many 'cool' interactive webstuff works on older devices nowadays...

------
kossae
All around great work!

Just a heads up if the author is around: I may have found a bug in the Break
Out example. Seems to have frozen when two balls collided just the right way:
[https://www.dropbox.com/s/12z2au9rkkw7hlm/Screenshot%202020-...](https://www.dropbox.com/s/12z2au9rkkw7hlm/Screenshot%202020-02-11%2017.55.37.png?dl=0)

------
crazypython
Game engine? This looks like just a sprite management library. Useful, but
nowhere close to what's needed to make a multiplayer HTML5 shooter.

~~~
newnewpdro
Agreed, this is basically just a glorified draw list, nowhere near a "game
engine".

Is there even a spatial index for accelerating collision detection?

~~~
fit2rule
The same author did Planck.js, so I imagine these are designed as modules to
work together. (Dunno yet, just discovered and reading..)

[http://piqnt.com/planck.js/](http://piqnt.com/planck.js/)

------
mrfusion
Where would you get some free assets for making a game on this? I want to do a
side scroller with some plants and mountains the background.

~~~
city41
Itch.io has free or very inexpensive assets. Also opengameart.org has free
assets.

------
elif
I'm curious why the decision to redraw the entire tree when a node has been
touched, rather than just that node or that branch?

~~~
Rotten194
Games typically need to redraw the entire screen anyways. Imagine a
sidescroller where even a 1px movement requires the entire background and
every object on top to be redrawn, or in 3D even a tiny camera move shifts the
position of every triangle on the screen. Even very simple games without a lot
of movement often have animations, where you then have to worry about
transparency so you may have to redraw the region under the animated element
anyways even of it doesn't move, etc. You could do a diff hoping for the happy
occasion of a mostly-static frame, but a) that gives a performance penalty to
the majority of frames that would need a total or near-total redraw anyways,
and b) would lead to either unstable FPS or pointlessly hitting the FPS cap.

There are exceptions to this, for example a visual novel or a turn-based
strategy game, but those are often satisfied to just eat the performance
penalty for the ability to use standard tooling, or can use engines or
standard UI toolkits like React that can do a temporal diff. For example, I've
written several text-based games [1] that just use the DOM because using
canvas or WebGL wasn't necessary. I've written other games that use a hybrid
approach of absolutely-positioning temporally diffed DOM over a frame-by-frame
redrawn canvas, to get the best of both worlds [2]. And I've also written
games in e.g. Unity where it's easier and performant enough to use ImGui and
redraw it every frame. Ultimately it cones down to what's practical and what's
performant enough.

[1] [https://vgel.itch.io/themengi](https://vgel.itch.io/themengi) ,
[https://vgel.itch.io/the-sacred-text](https://vgel.itch.io/the-sacred-text)
[2] [https://vgel.me/hoverator](https://vgel.me/hoverator)

~~~
victorNicollet
There used to be a time when the game would render to a buffer slightly larger
than the screen, then blit the right portion of that buffer to the screen.
This meant that scrolling just consisted in blitting from a different offset.
Composing the background image, then, would only require changing the bits
behind animated sprites (so you would usually intersect the old and new
position of each sprite with the background tile grid to find which tiles to
draw again).

All of this changed with the advent of 3d hardware acceleration, but I
remember doing it up until 2005 to get significant performance gains (on bad
hardware).

------
SteveSmith16384
What's the advantage of this over, say LibGDX where you can create HTML5,
Desktop, Android and iOS game all in one project?

~~~
theknarf
You won't need to write C++

~~~
SteveSmith16384
LibGDX is Java.

------
nottorp
Why did they have to say "cross platform"? Isn't HTML supposed to be cross
platform anyway? What do they even mean by 'platform'?

Disclaimer: I really don't know anything about doing games in html/js. The
question is honest.

Disclaimer 2: I do remember "write once, run anywhere". It was only mostly
right back then.

~~~
ZenPsycho
mobile and desktop devices, because although html is supposed to already be
cross platform, in theory, when it comes to games you have to make some
assumptions about whether a user is using a mouse or a touch screen or a
keyboard, specific screen sizes, testing on obscure browsers running linux and
old versions of gecko and things start to break

------
NKosmatos
This is great, I'll have to port my small board game from Python into this so
as to be able to run it cross platform. It's a little bit frustrating working
with the tkinter Python GUI and not being able to "export" the game to other
platforms.

------
luord
This is really good, a colleague of mine has always been interested in
creating a simple game, but he hasn't got the time for the big engines and all
that other stuff.

Something like this might be just what he needs.

------
plopz
Looks like a simpler version of Pixi.js without webgl support. I would imagine
its probably nicer to use for small games when you don't need webgl
performance.

------
downtide
Why would the plane demo devour 50% of my CPU? Intel P8400.

~~~
p1necone
That _is_ a 7 year old laptop cpu.

(Also if the demo is single threaded and not frame rate capped it probably
eats as much of a single core as it can, and that's a dual core cpu so 50%
checks out)

------
fit2rule
Reminds me very much of MOAI.

Any chance you're working on adding Box2D?

EDIT: n/m, I just saw Planck.js by the same author.. cool beans, will use ..

------
tartoran
Good job. Looking forward to playing with this.

------
ArtWomb
Good Job! Asteroids runs smooth ;)

