dudeperfect Posted January 14, 2015 Share Posted January 14, 2015 I am new to Phaser and I don't have a lot of experience in Javascript. I used to work with Java and C++(languages, which have something called classes). Here I can't do the same thing.---------------------------------------------------------------------------------------------------------------------------------I usually create states like this:Game.StateName = function(game) {}; Game.StateName.prototype = { create: function() {}, etc...}; So for example I want to create a custom object Player.I do that in another file.So do I need to create this same way? Game.Player = function(game) {}; Game.Player.prototype = { create: function() {}}; But doesnt it seem wrong? If I want to call their methods from outside? Maybe you can show me some basic and most common way to create custom objects? Link to comment Share on other sites More sharing options...
MichaelD Posted January 14, 2015 Share Posted January 14, 2015 You can view some examples of extending objects and basic player/enemy creation here: http://gamemechanicexplorer.com/ This site has helped me greatly. ultimatematchthree 1 Link to comment Share on other sites More sharing options...
paul_nicholls Posted May 16, 2015 Share Posted May 16, 2015 You can view some examples of extending objects and basic player/enemy creation here: http://gamemechanicexplorer.com/ This site has helped me greatly. Thanks for sharing that site MichaelD...I'm learing Phaser and this should be helpful cheers,Paul Link to comment Share on other sites More sharing options...
Tom Atom Posted May 16, 2015 Share Posted May 16, 2015 Hi, I started with Phaser + Javasript in January. and my background is also Java/C++. It is good to learn Javascript to know what is the same as Java/C++ and what is different. Also read about OOP in Javascirpt. But ... out first game was Phaser + Javascript and I used Netbeans IDE. Quite comforatble, but then I tried Phaser + Typescript in MS Viesual Studio 2013 Community Edition and I would never go back. Typescript gives you back most of the constructs you know from Java/C++ with type safety while keeping flexibility of Javascript. As I said, it is good to know how Javascript works (focus on "this" keyword - most confusing for Java/C++ people at first), but Typescript boosts productivity (especially if your project is larger). Link to comment Share on other sites More sharing options...
Recommended Posts