- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspawn.ts
More file actions
Latest commit
23 lines (18 loc) · 666 Bytes
/
Copy pathspawn.ts
File metadata and controls
23 lines (18 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// <reference path="primitives.ts" />
/// <reference path="protocols.ts" />
/// <reference path="object.ts" />
namespaceMapObjects{
exportclassSpawnpointextendsObject{
constructor(image:HTMLImageElement){
super(image);
this.area=Placement.AroundMap;
}
draw(context:CanvasRenderingContext2D){
context.drawImage(this.image,0,-this.image.naturalHeight);
}
hitTest(pt:Point){
letregion=newRect(newPoint(0,-this.image.naturalHeight),newSize(this.image.naturalWidth,this.image.naturalHeight));
returnregion.containsPoint(pt);
}
}
}