Computer Science Canada Looping a ForLoop? |
Author: | pers2981 [ Tue Nov 29, 2011 9:27 am ] | ||
Post subject: | Looping a ForLoop? | ||
This is my first post, Sorry if I some how mess up the post format or act like a total noob. What is it you are trying to achieve? I'm trying to create a wave based "castle defense" game were your job is to survive endless waves of increasing enemies who charge the castle. What is the problem you are having? I cant get the bad guys to move on time because they move in a for loop and I think forloops only execute once. Describe what you have tried to solve this problem None, I'm really confused on what else I should do / try. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Field.bmp can be found here. ![]() Uploaded with ImageShack.us
Please specify what version of Turing you are using 4.1.1 |
Author: | Raknarg [ Tue Nov 29, 2011 12:42 pm ] |
Post subject: | RE:Looping a ForLoop? |
The obvious solution is then to move them out of a for loop; have all the actions happen at the same time. Instead of moving the enemy across the field then using the other procedures, have them move while everything else is happening as well. Also, you'll run into another error: You can't set the upper bounds of an array to a variable and change it how you like, it requires different syntax. |
Author: | pers2981 [ Tue Nov 29, 2011 2:53 pm ] |
Post subject: | RE:Looping a ForLoop? |
But then how would I move the bad guys? if I got rid of the for loop that is. |
Author: | Tony [ Tue Nov 29, 2011 2:55 pm ] |
Post subject: | RE:Looping a ForLoop? |
same as you would move anything else. Everyone takes a turn to move a step. Repeat. |
Author: | Raknarg [ Tue Nov 29, 2011 3:51 pm ] |
Post subject: | RE:Looping a ForLoop? |
And whatever you do, do not use processes for it, as some are inclined to do. |
Author: | evildaddy911 [ Wed Nov 30, 2011 9:05 am ] | ||
Post subject: | Re: Looping a ForLoop? | ||
Quote:
what does this do? |