rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
461 stars 50 forks source link

Handle errors in loadData method #1

Closed yoannmoinet closed 9 years ago

yoannmoinet commented 9 years ago

Avoid crashing the app if the json file doesn't load via the loadData method.

If we don't get a 200 status, we return with a app.loader.error. This way we don't parse something nonexistent.


On a sidenote, I couldn't create the zip files with the build. Can you help me with the build process @rezoner. I guess that you're on a mac because I couldn't find a zip command for windows.

Awesome framework :+1:

rezoner commented 9 years ago

Hiya,

Thanks for a reasonable fix. I have merged it.

About contributing - please be aware that I am really hesitant to add new features as playground is meant to be an essential framework (not an engine like Phaser) - so if you have ideas for some cool features in mind and don't want to be disappointed with my rejective attitude it might be reasonable to look at plugins API.

As for build step on windows - I am using shjs which you probably already figured out - but the ZIP command comes from linux (I am on Ubuntu) and I don't know how to make it work on windows.

I think you could either use ubuntu on a virtual machine (which is simpler than it sounds) Or give it a try and use Ubuntu from a pendrive. I would also try cygwin which looks just like linux command line for windows.

yoannmoinet commented 9 years ago

Thanks for your quick answer.

For the contribution, it wasn't about adding new features, I totally agree with you on the plugin's architecture, the simpler it stays, the better it will be. The plugin API is simple and easy enough. Don't really need more.

I've already made one. To allow persistence. It's AMD and global wise. I was about to publish it on bower.

Are you ok if I proceed like that ?

rezoner commented 9 years ago

I haven't yet decided what's the most optimal way to avoid conflicts in plugin ecosystem and how to share them with public - but bower looks to be widely used solution. And THREE.js which is a reference for me also supports it.

I would appreciate if you could post your plugin somewhere, so I could examine how it looks from the end-user point of view.

Sorry for my ignorance, I am a bit lost in this endless jungle of precompilers and packagers - npm, babelify, browserify, bower, yeoman.....

yoannmoinet commented 9 years ago

There is no problem. I'll share with you a link soon enough.

It'll be on github, and published on bower and probably on npm too.

I think you should maybe consider doing the same for your framework. If you need I can prepare it for you (in a PR), and you'll just have to launch the publish command to auth them with your name.

yoannmoinet commented 9 years ago

here is the plugin https://github.com/yoannmoinet/playground.memorycard It's published on npm and bower.