Variables! — The building blocks of programming

George Asiedu
Jul 8, 2022

--

To be able to make our game we need to be able to make our player do actions. These actions must be given names and identified within the script of our player. Anything in games is a sort of variable assigned to an element whether it is a skill or an attribute.

For example making our player move we had to decide how we declare the speed:

Here “speed” has been made as a Float variable, this means it is a decimal and the number must end with an f.

Ever variable has a name, data type, size and value

We can declare the name.

The main data types are Integer, Float, String and Boolean

Integer = being a whole number

Float = a number with a decimal point

String = a sequence of characters

Boolean = true or false

--

--

No responses yet