-
speed = 1;
if (Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300) {
speed++}
the question is....when I make some variables and want to assign some values when do I write them with the ; in the end end when i sholudn't??
if i was gona write ......{speed++; ot=5; and maybe some other variables}
did i put it ok or not correct me please and explain how it goes
-
Well if you want to put them all on a single line that's almost right. the speed++ does not require a ; after it.
if (Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300)
{speed++ ot=5; othervar=1;}
You'll find it's easier to read if you put the statements below eachoter though (recommended).
if(Key.isDown(Key.BACKSPACE ) and Number(t-ot)<300){
speed++
ot=5;
othervar=1;
}
The if statement is not finished untill the last } is set so you do not have to worry about putting the } directly below the if() or anything like that.
Hope that helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|