Skip to content

Commit

Permalink
feat: Score points on enemy squash and slice land
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacurtiss committed Jun 14, 2024
1 parent c2304f8 commit 75cdb84
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/scenes/GameScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { LevelOpt, TimerController } from 'kaboom';
import { k, urlParams, BURGERTIME_BLUE } from '../kaboom';
import { levels } from '../objects/Level';
import { waitSpawnPowerup } from '../objects/Powerup';
import { Enemy, addEnemy } from '../objects/Enemy';
import { Enemy, ON_SQUASH, addEnemy } from '../objects/Enemy';
import { ON_WIN, PeterObj } from '../objects/Peter';
import { addSlice, ON_SLICE_FALL, ON_SLICE_PLATE } from '../objects/Slice';
import { addSlice, ON_SLICE_FALL, ON_SLICE_LAND, ON_SLICE_PLATE } from '../objects/Slice';
import { ON_DIE, ON_LIVES_CHANGE } from '../abilities/Alive';
import { DetectableObj } from '../abilities/Detect';
import { ON_SALT_CHANGE } from '../abilities/Salt';
Expand Down Expand Up @@ -292,6 +292,15 @@ export default function(options: Partial<GameSceneOpt>) {
p.setIntendedDir(dir);
});

// Scoring
on(ON_SQUASH, 'enemy', ()=>{
player.score += 100;
});
on(ON_SLICE_LAND, 'slice', slice=>{
player.score += 50;
player.score += slice.enemies.length * 100;
});

// Cheat Codes
let keylog = '';
let keylogTimer: TimerController;
Expand Down

0 comments on commit 75cdb84

Please sign in to comment.