Raccoon walks around badly
This commit is contained in:
@ -82,6 +82,20 @@ export class Size {
|
||||
}
|
||||
}
|
||||
|
||||
export class Rect {
|
||||
readonly top: Point;
|
||||
readonly size: Size;
|
||||
|
||||
constructor(top: Point, size: Size) {
|
||||
this.top = top;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
contains(other: Point) {
|
||||
return (other.x >= this.top.x && other.y >= this.top.y && other.x < this.top.x + this.size.w && other.y < this.top.y + this.size.h);
|
||||
}
|
||||
}
|
||||
|
||||
export class Grid<T> {
|
||||
readonly size: Size;
|
||||
#data: T[][];
|
||||
|
@ -71,7 +71,7 @@ class Drawing {
|
||||
return mainFont.measureText({text, forceWidth})
|
||||
}
|
||||
|
||||
drawSprite(sprite: Sprite, position: Point, ix?: number, options?: {xScale?: number, yScale: number, angle: number}) {
|
||||
drawSprite(sprite: Sprite, position: Point, ix?: number, options?: {xScale?: number, yScale: number, angle?: number}) {
|
||||
position = this.camera.negate().offset(position);
|
||||
|
||||
let ctx = getScreen().unsafeMakeContext();
|
||||
|
Reference in New Issue
Block a user