Hello, the is BurritoSM. On my old account, I created a terrain generator. It worked well, but the terrain overall was incredibly bumpy. I know of a way to make it a lot smoother, but it involves lists, or creating 480 extra variables, which, quite frankly, I do not need. The only problem I have, though, is that I have no clue where to even start with lists. What I basically want it to do, is to track each location on the y axis for all 480 points in my generator, and then, come back behind the bumpiness and make it smooth. If someone could explain to me how to use lists, or, more in particular, how to do something related to this using lists, I would be greater. I have seen amazing projects made of very complex lists, so, I know for a fact, that i will make better projects overall if I am correctly introduced to this feature. Thanks, BurritoSM.
Offline
Here's a quick summary of lists that should kick start you:
Lists are basically lists of "data". Think of them as the mother of variables, they hold as many variables as you want, each time you add a piece of data to the list it separates that from the rest, so you can reference (use) that data later, unlike making a variable that has a bunch of different data pieces in it but you can't use them, because they aren't separated. So, think of lists just like an easy way to make variables and use them. Remember how you can use that little orange circular block that has the name of the variable on it to "spit" the variables data out and use it? (Like make the sprite move [the amount in this variable: variable1]) well, you can do that with lists too, just use the "item [1] of [list1]" round block to get the data from a specific variable you added.
Offline
BurritoSM wrote:
So, if I am correct, you're saying that I could mark each y coordinate into one list, then go all 480 times, with it knowing each and every correct position, very simply?
Thanks, I think that may help a bit.
Yes, you are correct.
Offline
I just tried it, though I have encountered one problem; I can't seem to figure out how to make it go to the next variable, within the list. As in, I can't figure out how to make the sprite recognize where in the list it is.
Offline
BurritoSM wrote:
I just tried it, though I have encountered one problem; I can't seem to figure out how to make it go to the next variable, within the list. As in, I can't figure out how to make the sprite recognize where in the list it is.
Well for that, you might have to create a new variable called position. And then, change (position) to whatever item you might to effect in the list and use (position) whenever you want something from the list. For example:
(item (position) of [list v])And:
replace item (position) of [list v] with [:)]I hope that this helps!
Last edited by ErnieParke (2012-11-12 20:11:49)
Offline