Tuesday, July 28, 2009

Variables: an Introduction to programming.

Variables are part of the building blocks of any piece of software, and when designing a game you have to think in "variables", if you think of a computer game you have played, if there is a SCORE, then the SCORE is a variable, it is a number that changes over the course of the game.

Variables dont just have to be numbers, variables can consist of all sorts of data, but to keep it simple we will stick to thinking as variables as numbers for the most part.

examples of other types of data as variables could be a players name, or there health, or other attributes they have. If they have a weapon ready, that ia a variable, and the ammunition of that weapon is another variable.

Variables need to be named so the "computer" can tell them apart, you need to assign names to each variable, so its best to keep a consistant format when naming them.

once you think of your game in variables, then its a lot easyer to start to put together. I will discuss Variables more later but this is to give you an idea of how you need to think about your game.

you can start working out what elements in your game are variables, and give them names, write this in a list then its easyer to program how those variables interact.

this list we will call an "array"...

No comments:

Post a Comment