Open AgrawalAmey opened 8 years ago
I believe you're talking about custom elements that are part of web component and not the custom web components. For now, we prefer to keep the things simple as much as possible. For any new developer coming in need not learn web components to contribute to Tux4ME. I think your idea will make things harder for any new developer. If you can justify it with more clarity, we shall discuss the issue further.
You can have a look at Codevinsky's Yeoman Generator for Phaser Projects and Justin's generator-phaser-browserify. I personally prefer the former one. On one hand It makes the development faster and makes your project more structured but as @Vigneshsekar said it might become a headache for new developers.
@Vigneshsekar Currently any developer wishing to add a game to the existing project will face problem writing code that matches the design followed by other games, more over risk of leaking code will continue to exist. If we have more developers coming in the deployment of each new game would take substantial amount of effort, while with custom elements encapsulating the games, the changes to core project will reduce to 3/4 lines of HTML. Further more the whole process can be automated.
Another solution to the same problem could be using ES6 modules, they are much easier to use. That would be a good option if we assume that the games are developed using phaser (or any method which does not require require writing heavy HTML/CSS). But not necessarily all developers would like to go with phaser, specially with rise of SVG 1.2 and web animations and not to mention the huge overheads of phaser. Hence I feel web components provide us with the ideal API for the purpose.
@AkshayAgarwal007 For the same reasons explained in paragraph two, I feel that the element should not be based on a particular library.
Yes that's very right @AgrawalAmey not all developers would prefer to use Phaser. And the choice of the game framework completely depends on the type of game one is making. For games as simple as this the choice of Phaser as a game framework is not very good I would say.
Your idea of custom web elements is good, just we have to keep a proper documentation because for new amateur developers this might not be a very straight forward way.
Also, If we can make a blog where we can write weekly posts on making new and simple games not necessarily using JavaScript but any tool especially targeted for teaching young kids coding and game development, then it could be very good for the kids as well as for Tux4Kids too. Kids who play the Tux games ,after growing up if they can learn to make the same games then it would be very interesting for them. Also these might help in a little marketing for the games that Tux4Kids make. A very simple blog built using jekyll and github pages. Just a thought!
@AgrawalAmey , To err is human. If you have made some mistakes in comments, its not fair to edit it after getting a reply. Post a new comment or mention it as an edit in your old comment.
@AkshayAgarwal007 , Could you please list the other game frameworks that may be well suited for games of this kind ?
I totally agree.We may need a blog of that kind. Thanks for the idea @AkshayAgarwal007. We will work on it
@Vigneshsekar I guess for most of the games which do not need physics simulation we do not need to add any framework as such, vanilla canvas works fine. If at all physics simulation is required the developer might go different ways, that is he might use a game engine like phaser or pandajs or might use a physics engine like cannonjs or matterjs. I personally prefer vanilla canvas for small games as it saves on loading time also performs better in many cases.
@Vigneshsekar We always don't have to look for so much efficiency, I would have also gone for Phaser, its awesome and after PhotonStorm have discontinued with pixi and made their own game-specific rendering engine I love it more. It's the most popular of all free and open source HTML5 game frameworks out there. Just that because it has too many features which we don't require in the games( even these games would function good without WebGL support) it might be a little unnecessary to use it because that is also associated with a high overhead. But still it is perfectly fine.
In favor of uniformity and modularity I believe the individual games should be wrapped up inside custom elements. We can also develop a scaffolding based polymer seed element yeoman generator, which would make it easier for new developers to develop games to enhance tux4me and also prevent chances of any leaking code.