Open r2vq opened 10 years ago
I've taken a brief look through the list and will continue to read through this but one that caught my eye is the Factory Pattern
since I more so like to make objects and its an easy way to create little libraries out of it for future games. I would still like suggestions however since I'm not sure how others like to code nor how you would like this game to be formatted.
The JavaScript we use should be written with a design pattern in mind that will make it easier to debug and add to as the game expands. One of the reasons for this is avoiding JavaScript's global namespace to prevent name collisions. Another reason for this is to keep the program modular and with each module maintaining a consistent interface.
Learning JavaScript Design Patterns by Addy Osmani has a good set of examples for different patterns that have succeeded in the past.
@yaxgames, can you refactor your script files to follow one of these patterns or a similar one that you find works well in JavaScript?
The Revealing Module Pattern might be good for us since we're pretty used to C# OOP. If, in your research, you find a more suitable design pattern, let's discuss it here and document it in the 001-alien-hunter-game wiki so that we can use it for all our JavaScript Modules. :)
I'm assigning this to @yaxgames since he's already created a few script files on b1fa4a0131a25e7aa8190c5d04dc8f72ee378aa2 but considering how this will affect all of us, I hope @delpillar, @terenceyan, @abasolojc can chime in with their opinion too.