Closed SkyzohKey closed 8 years ago
I've just cloned the repo and added the following to index.html
:
<script type="text/javascript" src="src/game/main.js"></script>
Sorry that I forgot to put some docs. You need to install the lesser-panda-cli to be able to run it since the engine supports ES6. And you do not need to include the main.js
manually since the cli server will do everything for you (ES6 -> ES5, import/export for JavaScript and CSS and inject scripts into HTML).
So all you need to do is:
npm i -g lesser-panda-cli
cd path/to/your/game
lpanda server
http://localhost:4000
in your browser and the game shows :smile: Things you may notice:
import
CSS styles from JavaScript (magic)Hope you like the engine :smile:
Ah, i was trying to package the cli tool by hand xD. Thanks for the mini-doc. I'm currently working on a multiplayer game. If i can manage to make it working using lesser-panda i'll probably contribute a lot to this project, since Panda.js seems to be dead. + ES6 is a way more cumfortable to work with than the ugly Panda.js syntax ;)
Edit:
npm ERR! Linux 4.3.5-300.fc23.x86_64
npm ERR! argv "node" "/bin/npm" "i" "-g" "lesser-panda-cli"
npm ERR! node v0.10.36
npm ERR! npm v3.7.1
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/lesser-panda-cli
npm ERR! 404
npm ERR! 404 'lesser-panda-cli' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
Edit2: npm i -g https://github.com/pixelpicosean/lesser-panda-cli
seems to work ;)
Glad to have the second user. Feel free to ask any questions I'll try my best to help. The engine is still under development but won't change too much since it's already stable for production, I am using it in all of my recent projects.
Yeah, that worked. "It works!" just shown! Thanks for this engine, could you link me (if they are open-source) to your recents projects please? :)
Sorry those games (client work) are not published yet. I am thinking about create some open source sample games like what Panda does since we have the second user :smile:
Well let me give you a brief introduction to the engine:
addTo
method to DisplayObject
and create a custom Animation
class if you don't like PIXI.MovieClip
either. So you get the FULL PIXI.js.engine
folder are written in ES5 and use CommonJS modules instead for faster recompiling during development. And scripts in any other folders inside src
will be transpiled into ES5 with the power of Babel.js.tag
based sequences which might be the best feature you can imagine that already exist in this engine. Timers, timelines, updatings are all tagged so that you can only pause some of them instead of everything. Think about such a case that you need to pause the game but still want the pause menu slide in, give a different tag to the slide-in animation and it will just work.And some introductions to the built-in modules:
audio
is included in the main.js
canvasquery
provide a canvas 2d based renderer, but it's not capable with PIXI. Read more about it here. I don't use it actually, maybe someday in the future.engine/pixi/index.js
.polyfill
contains some ES6 polyfills.resource-loader
brings resource loading functionality which is used by PIXI.js and you probably don't need to use it directly at all.storage
provides session and persistent data storage, take a look those files inside and you got it. session
and persistent
from this module is quite useful but you're not forced to use.analytics
is almost the same as the one of Panda.jscamera
is also the same as the one of Panda.js but I've add zoom/rotate/shake features.core
is the most important module, consider it as the game
variable of Panda.jsdevice
works like game.device
of Panda.jseventemitter3
is a fast EventEmitter implementation and is used in PIXI.js and some engine classes.keyboard
emits keyboard events, you need to subscribe to get noticed.loader
provides assets loading functon addAsset(path, key, settings)
physics
is almost the same of Panda.js which will be improved soon since I'm preparing to merge my NinjaPhysics plugin into it to provide more features.reactive
is a wrapper of Kefir.js, which is used for Reactive Programming. I am heavy FRP user so this is the most important module to me. Timers are replaced with built-in timer which makes it pretty useful.renderer
is just the base object of renderer, if you import PIXI or canvasquery related renderer instance will be added to this object.resize
provides some resize helper functionsrnd
is a random number generator like the one of Phaserscene
exports the Scene class. Scenes should all be sub-classes of it.timeline
is the Tween animation support, basic usage is included in the main.jstimer
is quite useful, use Timer.later
or Timer.interval
to create instancesutils
provide some math and list helpers.vector
provide a Vector
class that is used everywhere (I replaced the PIXI.Point with it), such as PIXI.DisplayObject.position
.
Can you provide some more details?