Replicating Sprites on Scene_Title

I have a plugin I am writing and I want this object to get repeated, and have them with different x, y, anchor.x, anchor.y and rotation. Here's my code:

Scene_Title.prototype.create_glitter = function() { this.glitter_object = new Sprite(); this.glitter_object.bitmap = ImageManager.loadTitle1('Glitter'); this.glitter_object.x = Math.floor((Math.random() * Graphics.boxWidth)); this.glitter_object.y = Math.floor((Math.random() * Graphics.boxHeight)); this.glitter_object.anchor.x = 1; this.glitter_object.anchor.y = -2; this.addChildAt(this.glitter_object, 4);}Scene_Title.prototype.update_glitter = function() { this.glitter_object.x += 2; this.glitter_object.y += 2; this.glitter_object.opacity += 2; this.glitter_object.rotation += 0.020;}those two are added in create() and update() of Scene_Title. My question is, I want to make them replicated on the screen, and each of them are having their own action and movement, just like the first sprite.

I am told you can use for loop for this, but never really know how. Anyone?

Thank you in advance.
you mean by glitter...like a particle? if yes you should check how works Weather it's woud explain how works particles
just make an array to keep track of all of them, and a for loop to cycle through them. this is basic programming.

Code:
Scene_Title.prototype.initialize = function() {	...	this._glitters = [];	...}Scene_Title.prototype.create_glitter = function() {	var glitter = new Sprite();	// make glitters	...	this._glitters.push(glitter);	this.addChildAt(glitter, 4);}Scene_Title.prototype.update_glitter = function() {	for (var i=0; i<this._glitters.length; i++) {		var glitter = this._glitters[i];		glitter.x += 2;		glitter.y += 2;		glitter.opacity += 2;		glitter.rotation += 0.020;	}}
Thanks a lot Amuseum, it works perfectly 🙂

Original thread: https://forums.rpgmakerweb.com/threads/replicating-sprites-on-scene_title.50087/