mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2025-01-18 10:23:58 +08:00
Remove bar-type overlay
If I have any use for this it'll still be here in the history
This commit is contained in:
parent
7bb22ab2bd
commit
b19b60cd8d
@ -13,7 +13,6 @@ import { Shape, Stage, Shadow, Text, Ticker, Container, Tween, CSSPlugin, Ease }
|
|||||||
import { Constants } from './constants';
|
import { Constants } from './constants';
|
||||||
import { Card } from '../overlay/card';
|
import { Card } from '../overlay/card';
|
||||||
import { bindCallback, timer, Observable, Subscription } from 'rxjs';
|
import { bindCallback, timer, Observable, Subscription } from 'rxjs';
|
||||||
import { Bar } from '../overlay/bar';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-game',
|
selector: 'app-game',
|
||||||
@ -44,7 +43,6 @@ export class GameComponent implements OnInit, OnDestroy {
|
|||||||
waitCard: Card;
|
waitCard: Card;
|
||||||
waitingTimer: Observable<number>;
|
waitingTimer: Observable<number>;
|
||||||
waitingSub: Subscription;
|
waitingSub: Subscription;
|
||||||
bar: Bar;
|
|
||||||
|
|
||||||
players: Map<string, Player> = new Map<string, Player>();
|
players: Map<string, Player> = new Map<string, Player>();
|
||||||
obstacles: Obstacle[];
|
obstacles: Obstacle[];
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
import { Container, DisplayObject, Shape, Tween, Ease } from "createjs-module";
|
|
||||||
import { Constants } from "../game/constants";
|
|
||||||
|
|
||||||
export class Bar {
|
|
||||||
private readonly DURATION = 500;
|
|
||||||
|
|
||||||
object = new Container();
|
|
||||||
|
|
||||||
get displayObject(): DisplayObject {
|
|
||||||
return this.object;
|
|
||||||
}
|
|
||||||
|
|
||||||
height: number;
|
|
||||||
width = Constants.BOARD_SIZE;
|
|
||||||
backgroundCommand: Object;
|
|
||||||
backgroundMask = new Shape();
|
|
||||||
background = new Container();
|
|
||||||
contents = new Container();
|
|
||||||
|
|
||||||
get contentContainer(): Container {
|
|
||||||
return this.contents;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(height: number, color?: string) {
|
|
||||||
this.height = height;
|
|
||||||
|
|
||||||
this.contents.x = -100;
|
|
||||||
// this.contents.x = 0;
|
|
||||||
this.contents.y = 0;
|
|
||||||
|
|
||||||
this.backgroundCommand = this.backgroundMask.graphics
|
|
||||||
.beginFill('black')
|
|
||||||
.rect(0, 0, 0, this.height)
|
|
||||||
.command;
|
|
||||||
|
|
||||||
this.background.mask = this.backgroundMask;
|
|
||||||
this.contents.mask = this.backgroundMask;
|
|
||||||
|
|
||||||
const backgroundHeader = new Shape();
|
|
||||||
backgroundHeader.graphics.beginFill('#33307e').rect(0, 0, this.width, this.height / 3);
|
|
||||||
|
|
||||||
const backgroundBody = new Shape();
|
|
||||||
backgroundBody.graphics.beginFill('#03004e').rect(0, this.height / 3, this.width, 2 * this.height / 3);
|
|
||||||
|
|
||||||
this.background.addChild(backgroundHeader);
|
|
||||||
this.background.addChild(backgroundBody);
|
|
||||||
|
|
||||||
this.background.alpha = 0;
|
|
||||||
this.contents.alpha = 0;
|
|
||||||
|
|
||||||
this.object.addChild(this.background);
|
|
||||||
this.object.addChild(this.contents);
|
|
||||||
|
|
||||||
this.object.x = 0;
|
|
||||||
this.object.y = Constants.BOARD_SIZE / 2 - height / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
|
||||||
Tween.get(this.backgroundCommand).to({w: this.width}, this.DURATION, Ease.quadOut);
|
|
||||||
Tween.get(this.background).to({alpha: 0.8}, this.DURATION / 2, Ease.linear);
|
|
||||||
|
|
||||||
Tween.get(this.contents).to({alpha: 1}, this.DURATION, Ease.quadOut);
|
|
||||||
Tween.get(this.contents).to({x: 0}, this.DURATION, Ease.quadOut);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user