|
Tutorial Basic GSC Coding: Operations
|
|
Post: #1
|
|||
|
|||
|
Basic GSC Coding: Operations
Hello
This is another basic tutorial I wanted to make before doing a tutorial about making your first codes. This one is about numbers and math functions ( I am not going to teach you maths guys ).In cod you can use 2 kinds of numbers, "int"s and "float"s. "Int"s are entire numbers ( 2, 3, 50, 1000, 45 ... ) and "float"s are decimal numbers ( 1.1, 4.324, 6.67, 3.141592 ... ). If you have for example the number 5.31 you can do some operations with it, like: Code: Int( 5.31 ) //will return 5The game also has some interesting functions relationed with "Int"s and "Float"s which give you random numbers, they are this 4: Code: randomInt( number )Lets put some real examples with them: Code: luckynumber = randomInt( 6 ); //will give a random number beetween 0 and 6 Also the game allows you to use some basic operations such as: divisions, multiplications..... They work like this with real examples ( I recommend doing operations with pathenthesys: "( )" ): Code: plus = ( 3 + 15 ); // 18Well, thats it, if you dont know what is mathematic operation -> Google it Thanks for reading, @Yamato
![]() |
|||
The following 2 users say Thank You to Yamato for this post:Bloodfocus (04-04-2012), SailorMoon (04-04-2012) |
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder



).![[Image: veovuq.png]](http://i44.tinypic.com/veovuq.png)



![[-]](images/twilight/collapse.gif)