"Comments" are lines in a program which don't do anything as such
They serve as reminders about things, or you can temporarily comment out things which are not working or you don't currently need. You write special syntax at the beginning of the line, it is then ignored as though it wasn't there.
Writing // at the beginning of a line turns it into a comment. So, if you change the first line of this to:
//ghostcartoon.png (or, just delete this line)
The code will then work, as this is the line which is causing a problem.
There is a second way of writing comments also- write /* and */ at the beginning and end of some code. This is an easy way of commenting out a large amount of code, without having to do it line by line as you would if you used the method above.
For example:
/*in a game's code, this
entire block of text will be
ignored by the compiler, due to the
symbols I've left at the beginning and end*/
Sometimes we put code into games which are for diagnostic/testing purposes only, and you can use block comments to "turn off" this code when you release your game- so, it's disabled but you've still got it there if you need it in future.
freddie2013
werwe
what
1 month ago
bigblind
Winner!
1480
Tue Apr 10, 22:56
seb
"Comments" are lines in a program which don't do anything as such
They serve as reminders about things, or you can temporarily comment out things which are not working or you don't currently need. You write special syntax at the beginning of the line, it is then ignored as though it wasn't there. Writing // at the beginning of a line turns it into a comment. So, if you change the first line of this to: //ghostcartoon.png (or, just delete this line) The code will then work, as this is the line which is causing a problem. There is a second way of writing comments also- write /* and */ at the beginning and end of some code. This is an easy way of commenting out a large amount of code, without having to do it line by line as you would if you used the method above. For example: /*in a game's code, this entire block of text will be ignored by the compiler, due to the symbols I've left at the beginning and end*/ Sometimes we put code into games which are for diagnostic/testing purposes only, and you can use block comments to "turn off" this code when you release your game- so, it's disabled but you've still got it there if you need it in future.
Mon Apr 9, 11:12
addy
comment?
comment what? i dont get it..
Sun Apr 8, 18:46
hamid1455
comment out the first line
if you comment out the first line, the game works.
Sun Apr 8, 18:37
bigblind
project is broken
'nuff said
Fri Apr 6, 23:12