Hello, I am currently working on a Flappy Bird clone. I’ve added a score Label on the top right and I noticed that the score is below the pipe, meaning it would cover the score when the pipe moves across the screen. I want to make it so the score is always on top.
function create() {
// PIPES //
this.pipes = this.physics.add.group();
var spawnPipeTimer = this.time.addEvent({
delay: 3000,
callback: this.spawnPipe,
callbackScope: this,
loop: true
});
this.spawnPipe = function () {
var top_pipe = this.pipes.create(800, -50 , 'top-pipe');
var btm_pipe = this.pipes.create(800, 650 , 'btm-pipe');
this.pipes.add(top_pipe)
this.pipes.add(btm_pipe)
}
// SCORE //
this.score = this.add.text(0,0, "Score")
}
function update(t, dt) {
// Pipes //
this.pipes.children.iterate(function(pipe) {
pipe.setVelocityX(-120);
});