Pacman Arc
Demonstrates how to use the Graphics.slice method to draw a partial circle, creating a filled Pacman-style shape.
800 × 600
class Example extends Phaser.Scene
{
create ()
{
const graphics = this.add.graphics();
graphics.fillStyle(0xffff00, 1);
graphics.slice(400, 300, 200, Phaser.Math.DegToRad(340), Phaser.Math.DegToRad(20), true);
graphics.fillPath();
}
}
const config = {
scale: { mode: Phaser.Scale.FIT },
width: 800,
height: 600,
type: Phaser.AUTO,
parent: 'game-container',
scene: Example
};
const game = new Phaser.Game(config);