List: Difference between revisions
m
no edit summary
(→Related: Add 2D lists as related page) Tags: Mobile edit Mobile web edit |
-u ndefined- (talk | contribs) mNo edit summary |
||
| Line 1: | Line 1: | ||
A '''list''' is a collection of values stored under one name. | A '''list''' is a collection of values stored under one name. | ||
It is used for storing lots of values without creating lots of [[variables]]. | It is used for storing lots of values without creating lots of [[variables]]. | ||
It is what you call an | It is what you call an '''array''' in other programming languages. | ||
Every value in a list is assigned an index. | Every value in a list is assigned an index. | ||
| Line 25: | Line 25: | ||
== Example == | == Example == | ||
=== Managing several bullets === | |||
Here is the script for when a player shoots a bullet. | Here is the script for when a player shoots a bullet. | ||
| Line 50: | Line 52: | ||
The script runs for every bullet and our problem is solved! | The script runs for every bullet and our problem is solved! | ||
=== Processing multiple objects === | |||
Here is a simpler example that demonstrates how to create multiple objects and process them all at once: | Here is a simpler example that demonstrates how to create multiple objects and process them all at once: | ||