Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

destroy object on collision phaser

// set overlap for enemy bullets
        this.physics.add.overlap(this.ship, this.enemyBullets, (ship, bullet) => {
            this.health -= 10
            bullet.destroy()
        })
 
PREVIOUS NEXT
Tagged: #destroy #object #collision #phaser
ADD COMMENT
Topic
Name
3+1 =