Data Types in Coding

spaceship.PNG

Today we worked on code for a 2D spaceship game in Unity. We focused on the data types we were using in the code and the main four which were Boolean (true or false), integer (a whole number), float (a decimal number) and string (a chain of characters).

code

We wrote this code together which allowed us to get our spaceship (seen in the first image) to move. The image of code above shows us the data types float and vector 2. It also shows an access modifier seen as “public” which allows us to be able to change the spaceships thrust speed and rotation speed within unity in the inspector tab as seen in the image below.

public

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s