Login

Fancade Wiki

Updated List Element.md (markdown)

... ...
@@ -15,4 +15,10 @@ Let me explain the script:
15 15
16 16
So far so good, until the player shoots again adding another bullet. The variable can only store one value at a time, so the first bullet and its velocity are replaced with the second, the second bullet moves like it should, but the first bullet stop because it's no longer affected by the script. How do we fix that?
17 17
18
[[/uploads/Screenshot_20210107-114652_Fancade.jpg]]
... ...
\ No newline at end of file
0
[[/uploads/Screenshot_20210107-114652_Fancade.jpg]]
1
2
Lists are like variables, but they can store more values in one, so we just have to store the bullets and their velocities like so. We have to make sure to increment the index, otherwise the next bullet would be stored in the list with the same index giving us the same problem we had with the previous script.
3
4
[[/uploads/Screenshot_20210107-121128_Fancade.jpg]]
5
6
Next thing we have to do is run the script for every bullet with a [[loop]]. We plug the Counter output of the loop into the Index input of our lists, which helps us get access to the individual values stored in the list. The script runs for every bullet in the list.
... ...
\ No newline at end of file
Fancade Wiki