Basically, I'm just throwing around the idea of creating a basic Javascript game - not to be actually played, just to increase my own Javascript knowledge.
I have two questions around this.
Firstly, I understand that Javascript is a client-side programming/scripting language for the web. Because of it being client-side, it has limitations. Therefore, is creating a game in Javascript for the real world (i.e. wih the intention of actually being distributed or shared for others to play) something that is recommended, and something that people/developers do?
Secondly - whilst creating my basic text-based role-playing game with HTML, CSS, and Javascript, I've come across something where I've stopped and began to think: "Is this how other developers do it?2 I'm very code-conscious like that, I don't tend to want to be write any old code which simply does the job, I like to write code as I believe programmers, and I often wonder whether I'm doing it like that.
The thing that caused me to stop and think this, was where I was creating a scenario in which the player would be encountered by a random enemy (out of five). To get the randomness, I created an Enemies array, and then just used Math.random to randomize that array. My question is whether I'm doing this in the right wat? If a programmer wanted to create a random encounter with an enemy, would they do the same thing - i.e., use an array and call a random element from that array? It just seems so simple to me that it wouldn't strike me as the correct way of doing it.
When playing a game, whether it's an online Flash game or an Xbox 360 console game, you never stop to think: "How did the programmer create this scenario? How did he get this enemy to appear here randomly, or this random event to occur here randomly?" When actually coding, though, these things pop up, and it leaves me wondering how profesisonal programmers go about doing things like that.
Thanks in advance to any help whatsoever. I know it's rather a long question, but I'm genuinely very interested in the subject, and being so new to game programming in general, there's so much I don't know and would like to ask, that I when end up asking questions like this, I end up asking or wondering more than I set out to.

New Topic/Question
Reply



MultiQuote








|