This site requires JavaScript, please enable it in your browser!
Greenfoot back
Robert2.0
Robert2.0 wrote ...

2013/5/25

Loop Statement Help

Robert2.0 Robert2.0

2013/5/25

#
What are some easy ways I can use the "for" statement in my game. This statement is require for my school project.
bourne bourne

2013/5/25

#
Iterating a list of Objects is probably most common in my opinion.
Robert2.0 Robert2.0

2013/5/25

#
bourne wrote...
Iterating a list of Objects is probably most common in my opinion.
could you give me example I don't really understand
danpost danpost

2013/5/25

#
The following are occasions where a loop is employed: Often, a for loop is used to add a large number of one type object into the world, or to iterate through an array to determine what actor to place in what cell. Sometimes a 'while' loop is used to make sure that objects placed randomly into the world do not end up on top of other objects already in the world.
Robert2.0 Robert2.0

2013/5/25

#
danpost wrote...
The following are occasions where a loop is employed: Often, a for loop is used to add a large number of one type object into the world, or to iterate through an array to determine what actor to place in what cell. Sometimes a 'while' loop is used to make sure that objects placed randomly into the world do not end up on top of other objects already in the world.
Sorry but I new to Greenfoot and programing in general. I need for statement for a school project game. We haven't learnt arrays. Could you give an example of a for statement with using a array.
danpost danpost

2013/5/25

#
A good source of information pertaining to programming in java can be found in the Java tutorials. The second section on the left titled in red (Trails Covering the Basics) is the place to start (especially the sub-section called 'Learning the Java Language'.
You need to login to post a reply.