Slide 24
Slide 24 text
Sprite's Draw Method
24
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
draw() {
this.context.drawImage(this.image,
this.currentFrame * this.size.width, 0,
this.size.width, this.size.height,
this.pos.x, this.pos.y,
this.size.width, this.size.height);
}This is the part that flips
between the two frames in
croissant.png