import { GameScene } from "../scenes/GameScene" ; import { PhysicsEntity } from "./PhysicsEntity" ; import { PIXEL_PER_METER } from "../constants" ; export class Snowball extends PhysicsEntity { public constructor ( scene , x , y , velocityX , velocityY ) { super ( scene , x , y , 0.25 * PIXEL_PER_METER , 0.25 * PIXEL_PER_METER ) ; this . setVelocity ( velocityX , velocityY ) ; } public draw ( ctx ) { ctx . save ( ) ; ctx . beginPath ( ) ; ctx . translate ( this . x , - this . y ) ; ctx . strokeStyle = "black" ; ctx . fillStyle = "white" ; ctx . beginPath ( ) ; ctx . arc ( 0 , - this . height / 2 , this . width / 2 , 0 , Math . PI * 2 , false ) ; ctx . fill ( ) ; ctx . stroke ( ) ; ctx . restore ( ) ; } }