Game Development Reference
In-Depth Information
Furthermore, any variables that shouldn't be directly accessed outside a class are preceded by an
underscore character. Having such a convention in your code is a good thing. It makes your code a
lot easier to understand. Another convention this topic follows is that in names consisting of multiple
words, each following word starts with an uppercase character:
function GameObjectList() {
...
}
GameObjectList.prototype.handleInput = function() {
...
};
var thisIsAVeryLongVariableName;
This way of naming variables is common in programming. Some people have tried to define
standards for naming schemes, such as Hungarian notation. In Hungarian notation, variable names
also contain information about their type. Have a look at the following example:
var bIsAlive = true;
The b character tells you that this variable is a Boolean variable. This can be useful information to
encode in a variable name, because JavaScript doesn't require programmers to provide the type
of a variable when the variable is declared. You may encounter Hungarian notation in code written
by other developers, although it's being used less and less now that compilers and development
environments can automatically provide all kinds of information about a variable, such as its scope,
the type it represents, and so on.
Mark: “In JavaScript you can write code in a hundred different ways. So, before
you start developing, think about what you are actually going to need in the end. If
you start out with a wrong approach, you will encounter many problems because of
that choice. Making the right choice is not always easy, though. In many cases, the
design of the game is not completed yet when you start developing. Sometimes you
realize in the end that you need some kind of visual effect in the game, but there is
no place in the code to put it.”
Producing Game Content
If you want your game to look good, you need nice game assets. Good game assets that show
coherency will make your game more attractive to players. This includes not only the visuals but also
sound effects and background music. Generally, sound and music are underestimated, but they're
important factors in establishing ambience. Watching a film without sound is a lot less fun than
watching it while you hear music that emotionally supports what is happening and sound effects that
give body to what characters are doing. Games also need music and sound effects, just like films.
 
Search WWH ::




Custom Search