hi, another problem: you can i change the first 10 variables of an array?
i've made an array with the x- and y-coördinate and the length + width of 10 cars, so there are 40 variables in the array.
but in my game, these variables change. how can the array change together?
Answers
http://wiki.processing.org/w/From_several_arrays_to_classes
Be more specific, please: how should this variables change? Anyway, as GoToLoop suggested, you should consider the idea of using classes instead of arrays.
Hello,
without following gotoloops good advice:
You should post some code. ;-)
Anyway.
When you have an array x you can say
so the x-position of car #3 would change by 5 (it drives right).
to make this easier you can write a for loop and say
(not tested)
Thus you change all cars in 2 lines. Nice, right? You use the i value as an index.
When you want to have the car's speed be different, make a new array speed with holds the speeds btw. and say
(pseudo-code)
Also when you display the cars, I hope you use the for-loop... ;-)
Chrisir ;-)