This server is intended for use for Academic Classwork related Git repositories only. Projects/repositories will generally be removed after 6 months following close of the semester. Inactive repositories from previous semester are now being archived when no activity for 365 days. They are renamed and marked as 'archived'. After 90 days in that state they will be removed from the system completely.

Commit 8726d648 authored by Pamela Petterchak's avatar Pamela Petterchak

routing for closing sequence

parent caa4bce5
<button mat-raised-button (click)="upgrade()">
<h4>
Upgrade
</h4>
<h4>Upgrade</h4>
</button>
<button mat-raised-button>
<img [src]="upgradeLevel" (click)="increment()" />
</button>
<h4># of Clicks: {{ totalClicks | async }}</h4>
\ No newline at end of file
<h4># of Pickles: {{ totalClicks | async }}</h4>
......@@ -10,23 +10,27 @@ export class ClickComponent {
readonly totalClicks = this.service.pickleCount;
readonly clickMulti = this.service.incrementsClicksVal;
upgradeLevel = 'assets/Hamburger.png';
upgradeList = ['assets/Hamburger.png', 'assets/BabyDill.png', 'assets/Spear.png', 'assets/Pickle.png', 'assets/GoldenPickle.png'];
upgradeList = [
'assets/Hamburger.png',
'assets/BabyDill.png',
'assets/Spear.png',
'assets/Pickle.png',
'assets/GoldenPickle.png',
];
upgradePrices = [1, 5000, 50000, 500000, 5000000];
upgradeCount = 1;
constructor(private service: GamePlayService) { }
constructor(private service: GamePlayService) {}
upgrade() {
if (this.service.checkEnough(this.upgradePrices[this.upgradeCount])) {
this.service.pickleUpgrade(this.upgradePrices[this.upgradeCount]).catch((err) => console.log(err));
this.service
.pickleUpgrade(this.upgradePrices[this.upgradeCount])
.catch((err) => console.log(err));
// changing next upgrade picture
this.upgradeLevel = this.upgradeList[this.upgradeCount++];
}
}
increment() {
......
<button mat-raised-button>
<a routerLink="/credits">Credits</a>
</button>
<div *ngIf="enoughPickles | async">
<button mat-raised-button>
<a routerLink="/closing-video">You Succeeded! Buy the Golden Fork!</a>
</button>
</div>
<mat-card class="title">
<mat-card-title>Test</mat-card-title>
</mat-card>
<app-accumulators></app-accumulators>
<div class="row">
<div class="column">
<mat-card class="title">
<mat-card-title>Resources</mat-card-title>
</mat-card>
<app-accumulators></app-accumulators>
</div>
<mat-card class="title">
<mat-card-title>Pickle Clicker</mat-card-title>
</mat-card>
<app-click></app-click>
<div class="column">
<mat-card class="title">
<mat-card-title>Pickle Clicker</mat-card-title>
</mat-card>
<app-click></app-click>
</div>
</div>
......@@ -7,6 +7,8 @@ import { GamePlayService } from './game-play.service';
styleUrls: ['./game-play.component.scss'],
})
export class GamePlayComponent implements OnInit {
readonly enoughPickles = this.service.enoughPickles;
constructor(private service: GamePlayService) {}
ngOnInit() {
......
......@@ -14,6 +14,9 @@ export class GamePlayService {
private readonly accumulates = new BehaviorSubject<number>(0);
readonly accumulatesVal = this.accumulates.asObservable();
private readonly enough = new BehaviorSubject<boolean>(false);
readonly enoughPickles = this.enough.asObservable();
constructor() {
console.log('Game service activated');
}
......@@ -70,7 +73,8 @@ export class GamePlayService {
this.pickles.next(this.pickles.value + this.accumulates.value);
if (this.pickles.value >= 100000000) {
clearInterval(accumulator);
this.enough.next(true);
}
}, 2000);
}, 1000);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment