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 0c04e3a1 authored by Pamela Petterchak's avatar Pamela Petterchak

Revert...

Revert "BBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBMerge branch 'master' of https://git-classes.mst.edu/pfpg7m/pickle-clicker"

This reverts commit e6252c0d, reversing
changes made to ff7ace73.
parent a517ec96
<!-- <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,7 +5,3 @@
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>
......@@ -10,27 +10,23 @@ 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() {
......
<div *ngIf="enoughPickles | async">
<button mat-raised-button>
<a routerLink="/closing-video">You Succeeded! Buy the Golden Fork!</a>
</button>
</div>
<button mat-raised-button>
<a routerLink="/credits">Credits</a>
</button>
<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>Test</mat-card-title>
</mat-card>
<app-accumulators></app-accumulators>
<div class="column">
<mat-card class="title">
<mat-card-title>Pickle Clicker</mat-card-title>
</mat-card>
<app-click></app-click>
</div>
</div>
<mat-card class="title">
<mat-card-title>Pickle Clicker</mat-card-title>
</mat-card>
<app-click></app-click>
......@@ -7,8 +7,6 @@ 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,9 +14,6 @@ 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');
}
......@@ -26,13 +23,12 @@ export class GamePlayService {
}
checkEnough(price) {
if (this.pickleCount >= price) {
if (this.pickles.value >= price) {
return true;
}
return false;
}
async pickleUpgrade(cost) {
this.incrementsClicks.next(this.incrementsClicks.value * 10);
......@@ -41,39 +37,31 @@ export class GamePlayService {
}
async jarUpgrade() {
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));
if (this.pickles.value >= 5) {
this.accumulates.next(this.accumulates.value + 5);
this.pickles.next(this.pickles.value - this.jarCost);
this.jars.next(this.jars.value + 1)
this.pickles.next(this.pickles.value - 5);
}
// need to add else to throw error
}
async barrelUpgrade() {
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));
if (this.pickles.value >= 50) {
this.accumulates.next(this.accumulates.value + 50);
this.pickles.next(this.pickles.value - this.barrelCost);
this.barrels.next(this.barrels.value + 1);
this.pickles.next(this.pickles.value - 50);
}
}
async siloUpgrade() {
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));
if (this.pickles.value >= 500) {
this.accumulates.next(this.accumulates.value + 500);
this.pickles.next(this.pickles.value - this.siloCost);
this.silos.next(this.silos.value + 1);
this.pickles.next(this.pickles.value - 500);
}
}
async reservoirUpgrade() {
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));
if (this.pickles.value >= 5000) {
this.accumulates.next(this.accumulates.value + 5000);
this.pickles.next(this.pickles.value - this.reservoirCost);
this.reservoirs.next(this.reservoirs.value + 1);
this.pickles.next(this.pickles.value - 5000);
}
}
......@@ -82,8 +70,7 @@ export class GamePlayService {
this.pickles.next(this.pickles.value + this.accumulates.value);
if (this.pickles.value >= 100000000) {
clearInterval(accumulator);
this.enough.next(true);
}
}, 1000);
}, 2000);
}
}
<!-- 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"
routerLink="/opening-video"
/>
<h1>Welcome to Pickle Clicker</h1>
<h2>Click My Pickle!</h2>
<img src="./assets/Pickle.png" alt="Pickle" width="50%" height="auto" class="center">
</div>
</body>
</html>
</body>
</html>
\ No newline at end of file
......@@ -5,6 +5,3 @@
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