Codenburger Posted October 29, 2014 Share Posted October 29, 2014 Hi, I am new to Phaser and I am going to be using JavaScript, coming from a Python background, using Oop ! May I ask, is Oop generally using with Phaser and JavaScript. Would Oop be a good way to create games with Phaser and JavaScript. This looks like a great Game engine. I can't wait to get stuck in. Codenburger Link to comment Share on other sites More sharing options...
UgnisKarolis Posted October 29, 2014 Share Posted October 29, 2014 OOP is probably the only way to create something bigger than a simple demo scene. Example of a Sprite object in Javascript https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/views/SpriteAnimated.js and example controller https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/exampleController.js.In reallity, code usually doesn't look that clean, this is how controller usually looks in reallity: https://github.com/UgnisSoftware/The-Lone-Wolf-Corp./blob/master/public/javascripts/states/space/SpaceController.js but the same OOP principles apply.Also, you should probably give TypeScript a try, it makes OOP much cleaner and Phaser fully supports it. Link to comment Share on other sites More sharing options...
Mathieu Anthoine Posted October 29, 2014 Share Posted October 29, 2014 You should try haxe-phaser Link to comment Share on other sites More sharing options...
Codenburger Posted February 18, 2015 Author Share Posted February 18, 2015 Thank you guys. Some things to think about there. Link to comment Share on other sites More sharing options...
Recommended Posts