I have the two following questions:
1. When you write the code you can do it in two different ways. You can write all the code directly in your gameloop or you can break it down in small functions and just call on these from the gameloop. What are the advantages and disadvantages with these two ways of designing a game?
2. I need this following code corrected and described what is wrong, how it should be (the correct code) and an explanation of what the code is supposed to do:
function randomize { /*this way you can insert explanations over several lines without the code breaking*/
randNum = int(math.random ()*60);
}
function evalRand(num, count) {
for(s=o; s<=count;) {
if(num == myArray[s]) {
return -1;
}
Return(1);
}
I'm very thankful for any response
1. When you write the code you can do it in two different ways. You can write all the code directly in your gameloop or you can break it down in small functions and just call on these from the gameloop. What are the advantages and disadvantages with these two ways of designing a game?
2. I need this following code corrected and described what is wrong, how it should be (the correct code) and an explanation of what the code is supposed to do:
function randomize { /*this way you can insert explanations over several lines without the code breaking*/
randNum = int(math.random ()*60);
}
function evalRand(num, count) {
for(s=o; s<=count;) {
if(num == myArray[s]) {
return -1;
}
Return(1);
}
I'm very thankful for any response
Comment