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 1f6895e7 authored by Pamela Petterchak's avatar Pamela Petterchak

fixin' git

parent 0c04e3a1
<!-- <mat-selection-list [multiple]="false">
<mat-list-option>
<a routerLink="/landing-page">Landing</a>
</mat-list-option>
<mat-list-option>
<a routerLink="/opening-video">Opening</a>
</mat-list-option>
<mat-list-option>
<a routerLink="/game-play">Game Play</a>
</mat-list-option>
<mat-list-option>
<a routerLink="/credits">Credits</a>
</mat-list-option>
</mat-selection-list> -->
<router-outlet></router-outlet>
......@@ -5,3 +5,7 @@
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
<button mat-raised-button>
<a routerLink="/credits">Thanks for playing! Go to credits</a>
</button>
<button mat-raised-button class="upgrade" (click)="upgrade()">
<h4>
Upgrade
</h4>
<h4>Upgrade</h4>
</button>
<h5 style="text-align: center; position: relative; bottom: 10px;">
<h5 style="text-align: center; position: relative; bottom: 10px">
Cost: {{ upgradePrices[upgradeCount] }}
</h5>
<button mat-raised-button>
<img [src]="upgradeLevel" (click)="increment()" />
</button>
<h4 class="numClicks"># of Clicks: {{ totalClicks | async }}</h4>
\ No newline at end of file
<h4 class="numClicks"># 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,7 @@ 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,25 @@ 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();
private readonly jars = new BehaviorSubject<number>(0);
readonly jarCount = this.jars.asObservable();
jarCost = 5;
private readonly barrels = new BehaviorSubject<number>(0);
readonly barrelCount = this.jars.asObservable();
barrelCost = 50;
private readonly silos = new BehaviorSubject<number>(0);
readonly siloCount = this.jars.asObservable();
siloCost = 500;
private readonly reservoirs = new BehaviorSubject<number>(0);
readonly reservoirCount = this.jars.asObservable();
reservoirCost = 5000;
constructor() {
console.log('Game service activated');
}
......@@ -37,31 +56,56 @@ export class GamePlayService {
}
async jarUpgrade() {
if (this.pickles.value >= 5) {
if (
this.pickles.value >=
this.jarCost + this.jars.value * (this.jars.value + 1) * 5
) {
this.jarCost = this.jarCost + this.jars.value * (this.jars.value + 1) * 5;
this.accumulates.next(this.accumulates.value + 5);
this.pickles.next(this.pickles.value - 5);
this.pickles.next(this.pickles.value - this.jarCost);
this.jars.next(this.jars.value + 1);
}
// need to add else to throw error
}
async barrelUpgrade() {
if (this.pickles.value >= 50) {
if (
this.pickles.value >=
this.barrelCost + this.barrels.value * (this.barrels.value + 1) * 50
) {
this.barrelCost =
this.barrelCost + this.barrels.value * (this.barrels.value + 1) * 50;
this.accumulates.next(this.accumulates.value + 50);
this.pickles.next(this.pickles.value - 50);
this.pickles.next(this.pickles.value - this.barrelCost);
this.barrels.next(this.barrels.value + 1);
}
}
async siloUpgrade() {
if (this.pickles.value >= 500) {
if (
this.pickles.value >=
this.siloCost + this.silos.value * (this.silos.value + 1) * 500
) {
this.siloCost =
this.siloCost + this.silos.value * (this.silos.value + 1) * 500;
this.accumulates.next(this.accumulates.value + 500);
this.pickles.next(this.pickles.value - 500);
this.pickles.next(this.pickles.value - this.siloCost);
this.silos.next(this.silos.value + 1);
}
}
async reservoirUpgrade() {
if (this.pickles.value >= 5000) {
if (
this.pickles.value >=
this.reservoirCost +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000
) {
this.reservoirCost =
this.reservoirCost +
this.reservoirs.value * (this.reservoirs.value + 1) * 5000;
this.accumulates.next(this.accumulates.value + 5000);
this.pickles.next(this.pickles.value - 5000);
this.pickles.next(this.pickles.value - this.reservoirCost);
this.reservoirs.next(this.reservoirs.value + 1);
}
}
......@@ -71,6 +115,6 @@ export class GamePlayService {
if (this.pickles.value >= 100000000) {
clearInterval(accumulator);
}
}, 2000);
}, 1000);
}
}
<!-- Formatting for landing page content here! -->
<html>
<body style="background-color:greenyellow">
<body style="background-color: greenyellow">
<div>
<h1>Welcome to Pickle Clicker</h1>
<h2>Click My Pickle!</h2>
<img src="./assets/Pickle.png" alt="Pickle" width="50%" height="auto" class="center">
<h1>Welcome to Pickle Clicker</h1>
<h2>Click My Pickle!</h2>
<img
routerLink="/opening-video"
src="./assets/Pickle.png"
alt="Pickle"
width="50%"
height="auto"
class="center"
/>
</div>
</body>
</html>
\ No newline at end of file
</body>
</html>
......@@ -5,3 +5,7 @@
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
<button mat-raised-button>
<a routerLink="/game-play">Go to the Pickle Farm</a>
</button>
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