DANI CODER WIKI
Dani Code is a language made specifically for Dani Coder to compile and run. This code is a bit similar to other languages, but the format is different. After every call, there is a period ("."), no curly brackets (" {} [] () "), no quotes for text (" '" "" "), only periods. However, all lines of code has to be ended with a semi-colon (";"), or you will find a lot of unwanted bugs, and the code would not work. Code runs from the top of the script to the bottom, so using two lines of code upon each other'll differ in results, according to which line you put first.
Dani Code has it's own built in properties, and conditions.
Built in properties types are:
1. _X: The x position of the object. (Higher the value, more right on screen, vice versa.)
2. _Y: The y position of the object. (Higher the value, more down on screen, vice versa.)
3. _W: The width of the object. (Higher the value, object width increase, vice versa.)
4. _H: The height of the object. (Higher the value, object height increase, vice versa.)
5. _D: The depth of objects. (Higher the value, object depth increase, vice versa.)
6. _C: The colour of the object. (This property cannot be used for text.)
7. _T: The text for the object. (This property can only be used for text.)
Dani Code uses 3 different conditions to run: 1. Var, 2. Set, and 3. Key.
1. Using variables: Variables are codes that give a named item, a specified value. In Dani Coder, "Var" is used to represent variables when being defined.
The basic format for a variable is:
Var.[Int/String].[varname].[value/name];
"Var" starts off the line of code. It lets the program know you want to define a variable.
[Int/String]. After the period ("."), you can choose what type of variable, you'll want the variable to be: an integer ("Int") [these are whole numbers], a string ("String") [these are text, like sentences or phrases].
[varname]. After you've defined your variable type, you give the variable a name. It can be whatever name you'll like it to be. It's common to give it an easy name to remember, for when you'll need to access it.
[value/name]. Finally, you add your value/name to your variable to define it. If the variable were an integer, you'll put a number there. If it were a string, put your string there. It does not need any quotes.
IMPORTANT: Use underscores ("_") instead of fullstops (".") for strings of text. The underscores'll be replaced by fullstops in the game itself. If you do not do this, however, you might have many unwanted bugs in your game, so make sure to read this! :IMPORTANT
So what if I wanted to make a string of text called 'introstring' that says "Hi. I'm Bob." I would type the following:
Var.String.infostring.Hi_ I'm Bob;
IMPORTANT: You do not need to put an underscore to end a phrase; that is automatically added for you in-game. :IMPORTANT
A few other ways to define variables are:
Var.Int.aspeed.20; -Make a variable called "aspeed" and give it the value 20.
Var.String.text.Bye; -Make a variable called "text" and give it the string "Bye".
Var.Int.leftspeed.-30; -Make a variable called "leftspeed" and give it the value -30.
2. Setting values. This condition allows users to change the values of object properties, or defined variables. In Dani Code, "Set" is used for changing these things.
The basic format for setting source is:
Set.[Source].[set_type].[Int/Var/String].[value/name];
"Set" starts off the line of code. It lets the program know that you want to change a source.
[Source]. After the period, you type whether you want to set a property, or a variable. NOTE: For source, you put either "Property" if you want to manipulate a property, or "Var" if you want to manipulate a variable.
[set_type]. In set_type, you put the specific type. If you chose var, you can put any variable name here. (If that variable exist, it'll overwrite it. If it does not exist, it'll add a new variable with that name.) If you chose property, you can use any property type, that you'd wish to change.
[Int/Var/String]. Here, you put whatever you'll want the source to be changed to. You can call a new integer, a new string, or a variable already defined.
[value/name]. You put the value of the string of text, or integer here. If it were a variable, you put the name of the variable here. NOTE: This variable has to be defined.
So what if I wanted to set a previous called var 'infostring' to the number 90, instead of another string? I would type the following:
Set.Var.infostring.Int.90;
A few other ways to change sources are:
Set.Property._X.Int.21; -Change the object's x to the integer 21.
Set.Var.avar.Var.text; -Change/Make the var avar value be a variable called text.
Set.Property._C.String.DDEEFF; -Change the object's colour to the string "DDEEFF".
3. Pressing buttons. With this, users check to see when a particular key is pressed, and acts based upon it. In Dani Code, "Key" is used for checking key presses.
The basic format for checking these things is:
Key.Down.[Letter/Arrow].[key_type].[Increment/Set].[Source].[Int/String/Var].[value/name];
"Key.Down" starts off the line of code. It let's the program know you are checking to see whether a key is down or not.
[Letter/Arrow]. If you want a letter to be pressed, you'd put "Letter", here, but if you want to check if an arrow is pressed, you'd want to put "Arrow" here.
[key_type]. Here, you define your letter or arrow. For letters, just type it capital. For arrows, type the spelling of the arrow, with the first letter capital.
[Increment/Set]. If you want to change a value when this key is pressed, use "Set". If you want to constantly increase on the objects current value while the key is being pressed, use "Increment".
[Source]. For this, you'll put the property you'll want to change, or the variable you'll want to change, when the key is pressed.
[Int/String/Var]. Here, you put whatever you'll want the source to be changed to. You can call a new integer, a new string, or a variable already defined.
[value/name]. You put the value of the string of text, or integer here. If it were a variable, you put the name of the variable here. NOTE: This variable has to be defined.
So what if I wanted to tell the computer, that when I press the arrow key "left", to change the object's x position to 20. There are multiple ways to do this. I would type the following:
Key.Down.Arrow.Left.Set._X.Int.20;
But what if I wanted to tell the computer, that when I press the arrow key "left", to decrease the object's x position by 20, constantly. There are multiple ways to do this. I can type the following:
Key.Down.Arrow.Left.Increment._X.Int.-20; -Decrease the x by the integer 20.
Key.Down.Arrow.Left.Increment._X.Var.leftspeed; -Decrease the x by the var leftspeed (-30).
Key.Down.Arrow.Left.Increment._X.Var.-aspeed; -Decrease the x by negative var aspeed (-20).
A few other ways to manipulate sources are:
Key.Down.Letter.A.Increment._T.String.Spam!; -Constantly add the text "Spam!" to the text box.
Key.Down.Letter.R.Set._W.Int.50; -Change the object width to the integer 50.
Key.Down.Arrow.Down.Set.text.Var.infostring; -Set the variable "text" to teh variable "infostring".
Key.Down.Arrow.Up.Increment.leftspeed.Var.aspeed; -Constantly change the variables value.
Different objects have their own codes, and some objects use code that won't work if it is used on another object. The main objects in Dani Coder are: 1.Stage, 2. rectangles, 3.ovals, 4.text.
Properties of the Stage: _X, _Y, _C.
Properties of the rectangle: _X, _Y, _W, _H, _C, _D.
Properties of the oval: _X, _Y, _W, _H, _C, _D.
Properties of the text: _X, _Y, _W, _H, _D, _T.
Dani Code has it's own built in properties, and conditions.
Built in properties types are:
1. _X: The x position of the object. (Higher the value, more right on screen, vice versa.)
2. _Y: The y position of the object. (Higher the value, more down on screen, vice versa.)
3. _W: The width of the object. (Higher the value, object width increase, vice versa.)
4. _H: The height of the object. (Higher the value, object height increase, vice versa.)
5. _D: The depth of objects. (Higher the value, object depth increase, vice versa.)
6. _C: The colour of the object. (This property cannot be used for text.)
7. _T: The text for the object. (This property can only be used for text.)
Dani Code uses 3 different conditions to run: 1. Var, 2. Set, and 3. Key.
1. Using variables: Variables are codes that give a named item, a specified value. In Dani Coder, "Var" is used to represent variables when being defined.
The basic format for a variable is:
Var.[Int/String].[varname].[value/name];
"Var" starts off the line of code. It lets the program know you want to define a variable.
[Int/String]. After the period ("."), you can choose what type of variable, you'll want the variable to be: an integer ("Int") [these are whole numbers], a string ("String") [these are text, like sentences or phrases].
[varname]. After you've defined your variable type, you give the variable a name. It can be whatever name you'll like it to be. It's common to give it an easy name to remember, for when you'll need to access it.
[value/name]. Finally, you add your value/name to your variable to define it. If the variable were an integer, you'll put a number there. If it were a string, put your string there. It does not need any quotes.
IMPORTANT: Use underscores ("_") instead of fullstops (".") for strings of text. The underscores'll be replaced by fullstops in the game itself. If you do not do this, however, you might have many unwanted bugs in your game, so make sure to read this! :IMPORTANT
So what if I wanted to make a string of text called 'introstring' that says "Hi. I'm Bob." I would type the following:
Var.String.infostring.Hi_ I'm Bob;
IMPORTANT: You do not need to put an underscore to end a phrase; that is automatically added for you in-game. :IMPORTANT
A few other ways to define variables are:
Var.Int.aspeed.20; -Make a variable called "aspeed" and give it the value 20.
Var.String.text.Bye; -Make a variable called "text" and give it the string "Bye".
Var.Int.leftspeed.-30; -Make a variable called "leftspeed" and give it the value -30.
2. Setting values. This condition allows users to change the values of object properties, or defined variables. In Dani Code, "Set" is used for changing these things.
The basic format for setting source is:
Set.[Source].[set_type].[Int/Var/String].[value/name];
"Set" starts off the line of code. It lets the program know that you want to change a source.
[Source]. After the period, you type whether you want to set a property, or a variable. NOTE: For source, you put either "Property" if you want to manipulate a property, or "Var" if you want to manipulate a variable.
[set_type]. In set_type, you put the specific type. If you chose var, you can put any variable name here. (If that variable exist, it'll overwrite it. If it does not exist, it'll add a new variable with that name.) If you chose property, you can use any property type, that you'd wish to change.
[Int/Var/String]. Here, you put whatever you'll want the source to be changed to. You can call a new integer, a new string, or a variable already defined.
[value/name]. You put the value of the string of text, or integer here. If it were a variable, you put the name of the variable here. NOTE: This variable has to be defined.
So what if I wanted to set a previous called var 'infostring' to the number 90, instead of another string? I would type the following:
Set.Var.infostring.Int.90;
A few other ways to change sources are:
Set.Property._X.Int.21; -Change the object's x to the integer 21.
Set.Var.avar.Var.text; -Change/Make the var avar value be a variable called text.
Set.Property._C.String.DDEEFF; -Change the object's colour to the string "DDEEFF".
3. Pressing buttons. With this, users check to see when a particular key is pressed, and acts based upon it. In Dani Code, "Key" is used for checking key presses.
The basic format for checking these things is:
Key.Down.[Letter/Arrow].[key_type].[Increment/Set].[Source].[Int/String/Var].[value/name];
"Key.Down" starts off the line of code. It let's the program know you are checking to see whether a key is down or not.
[Letter/Arrow]. If you want a letter to be pressed, you'd put "Letter", here, but if you want to check if an arrow is pressed, you'd want to put "Arrow" here.
[key_type]. Here, you define your letter or arrow. For letters, just type it capital. For arrows, type the spelling of the arrow, with the first letter capital.
[Increment/Set]. If you want to change a value when this key is pressed, use "Set". If you want to constantly increase on the objects current value while the key is being pressed, use "Increment".
[Source]. For this, you'll put the property you'll want to change, or the variable you'll want to change, when the key is pressed.
[Int/String/Var]. Here, you put whatever you'll want the source to be changed to. You can call a new integer, a new string, or a variable already defined.
[value/name]. You put the value of the string of text, or integer here. If it were a variable, you put the name of the variable here. NOTE: This variable has to be defined.
So what if I wanted to tell the computer, that when I press the arrow key "left", to change the object's x position to 20. There are multiple ways to do this. I would type the following:
Key.Down.Arrow.Left.Set._X.Int.20;
But what if I wanted to tell the computer, that when I press the arrow key "left", to decrease the object's x position by 20, constantly. There are multiple ways to do this. I can type the following:
Key.Down.Arrow.Left.Increment._X.Int.-20; -Decrease the x by the integer 20.
Key.Down.Arrow.Left.Increment._X.Var.leftspeed; -Decrease the x by the var leftspeed (-30).
Key.Down.Arrow.Left.Increment._X.Var.-aspeed; -Decrease the x by negative var aspeed (-20).
A few other ways to manipulate sources are:
Key.Down.Letter.A.Increment._T.String.Spam!; -Constantly add the text "Spam!" to the text box.
Key.Down.Letter.R.Set._W.Int.50; -Change the object width to the integer 50.
Key.Down.Arrow.Down.Set.text.Var.infostring; -Set the variable "text" to teh variable "infostring".
Key.Down.Arrow.Up.Increment.leftspeed.Var.aspeed; -Constantly change the variables value.
Different objects have their own codes, and some objects use code that won't work if it is used on another object. The main objects in Dani Coder are: 1.Stage, 2. rectangles, 3.ovals, 4.text.
Properties of the Stage: _X, _Y, _C.
Properties of the rectangle: _X, _Y, _W, _H, _C, _D.
Properties of the oval: _X, _Y, _W, _H, _C, _D.
Properties of the text: _X, _Y, _W, _H, _D, _T.