Skip to content

Commit 3f9766c

Browse files
committed
update JSWindow in Monopoly
1 parent bfc895b commit 3f9766c

2 files changed

Lines changed: 6 additions & 25 deletions

File tree

src/Monopoly/Classes.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,4 @@ class Place extends Rectangle {
1010
}
1111
}
1212

13-
class JSWindow extends Rectangle {
14-
name: string;
15-
color: string;
16-
visible: boolean;
17-
constructor(x: number, y: number, width: number, height: number, name: string) {
18-
super(x, y, width, height); //Inherit from Rectangle
19-
this.name = name;
20-
this.color = 'grey';
21-
this.visible = false;
22-
}
23-
24-
show() {
25-
this.y = -this.height - this.outlineWidth*2;
26-
for (let i = 0; i < (this.initY - this.y) * 100; i+=1) {
27-
this.y += 1/100;
28-
}
29-
}
30-
}
31-
32-
export { Place, JSWindow };
13+
export { Place };

src/Monopoly/Main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { canvasPadding } from './Initialization';
2-
import { Place, JSWindow } from './Classes';
3-
import { AnimationLOOP, GameState } from '../JSTools';
2+
import { Place } from './Classes';
3+
import { AnimationLOOP, GameState, JSWindow } from '../JSTools';
44

55
const canvas = (window as any).globals.canvas;
66

@@ -15,11 +15,11 @@ game.outlinePosition = "outer";
1515
game.showIndex = 1;
1616
game.visible = true;
1717

18-
const startWindow = new JSWindow(20,20,game.width-40,game.height-40,"Start Window");
19-
startWindow.visible = true;
18+
const startWindow = new JSWindow(game.width-40,game.height-40);
19+
game.container.startWindow = startWindow;
2020
startWindow.color = "#263599";
2121
startWindow.showIndex = 100;
22-
game.container.startWindow = startWindow;
22+
startWindow.show();
2323

2424
var pathWidth = 195*canvas.width/1000;
2525
var normalPlacesStep = (game.width-pathWidth*2)/5;

0 commit comments

Comments
 (0)