Variable data type

By default AppGameKit will treat the variable score as an integer. This means that the variable can only be used to store positive or negative whole numbers. The variable score could be assigned values such as 100, 0, -50 or 123.

score = 100
score = 0
score = -50
score = 123

There will come a time when your game requires different kinds of data, for example, you can't store the name of a player using an integer and it may be you want to control the speed of a ship with more precision, using a fractional number rather than an integer.

The way that AppGameKit handles this is to provide you with the option of declaring a variable and specifying its type. The three basic types of data storage available are.