This is my first post so I might not format everything right
(I’m using version 1.19.3)
I’m trying to make a rhythm game, and I’m trying to make it so that only the earliest spawned arrow clone will be removed when the corresponding key is pressed.
I’ve tried using an if statement to see if the clone is the first in the clones array.
if(this.isClone){
if(this.d){
this.remove();
}
this.y-=tempo/(project.framerate/2);
if(this.hits(LeftPlayer)){
if(isKeyJustPressed("a")){
if(this.n==LeftArrow.clones[0].n){
if(Math.abs(this.y-90)<5){
score+=10;
}
else if(Math.abs(this.y-90)<50){
score+=5;
}
else{
}
this.d=true;
}
}
}
}
else{
if(songlayout[beatcounter/2]==1){
this.clone();
this.n+=1;
this.clones[this.clones.length-1].n = this.n;
this.clones[this.clones.length-1].d = false;
}
}
Rhythm Game3-28-2022_9-49-47.wick (4.6 KB)