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 e6252c0d authored by pmdv46's avatar pmdv46

BBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBB...

BBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBMerge branch 'master' of https://git-classes.mst.edu/pfpg7m/pickle-clicker
parents ff7ace73 1a80514c
<!-- <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>
......@@ -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');
}
......@@ -23,12 +26,13 @@ export class GamePlayService {
}
checkEnough(price) {
if (this.pickles.value >= price) {
if (this.pickleCount >= price) {
return true;
}
return false;
}
async pickleUpgrade(cost) {
this.incrementsClicks.next(this.incrementsClicks.value * 10);
......@@ -37,31 +41,39 @@ 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);
}
}
......@@ -70,7 +82,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);
}
}
<!-- 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
src="./assets/Pickle.png"
alt="Pickle"
width="50%"
height="auto"
class="center"
routerLink="/opening-video"
/>
</div>
</body>
</html>
\ No newline at end of file
</body>
</html>
......@@ -5,3 +5,6 @@
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