You make things so much simpler.
All I have to do now is add the images of random trash and presto.
Would you possible know how to put names and images in an array?
maybe something like.
PHP Code:
temp.trash = {
{"trashone.png", Name},
{"trashtwo.png", Name}
};
I believe this is how a "3D" array works?
But how would you read the information from that and pick a random trash object O_O
PHP Code:
this.chosen = random(0, temp.trash.size());
Yet again im probably horribly wrong.
I was just thinking doing an array would make it look much nicer and be easier to add more items, rather than doing this.
PHP Code:
temp.chosen = random(1, 3);
if (temp.chosen == "1") {
this.item = "Garbage 1";
this.image = "Image for it";
}
if (temp.chosen == "2") {
this.item = "Garbage 2";
this.image = "Image for it";
}
if (temp.chosen == "3") {
this.item = "Garbage 3";
this.image = "Image for it";
}