Skip to content

Commit

Permalink
add some objectives
Browse files Browse the repository at this point in the history
  • Loading branch information
maladr0it committed Jan 29, 2024
1 parent ec09823 commit 9a5032b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/entities/Objective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Objective extends Entity {
}
update(dt: number) {
this.total_time += dt;
this.y = GROUND_LEVEL / -4 + Math.sin(this.total_time * 5) * 60;
this.y = GROUND_LEVEL / -5 + Math.sin(this.total_time * 5) * 30;
this.x = this.offset - state.distance;
if (state.distance > this.offset) {
this.x = SCENE_SIZE.x + (this.x % SCENE_SIZE.x);
Expand Down
17 changes: 14 additions & 3 deletions src/level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { Spider } from "./entities/Spider";
import { GhostCactus } from "./entities/GhostCactus";
import { CactusWithGun } from "./entities/CactusWithGun";
import { GunPickup } from "./entities/GunPickup";
import { createEthCableObjective } from "./entities/Objective";
import {
createEthCableObjective,
createModemObjective,
createRouterObjective,
} from "./entities/Objective";

export const generateLevel = (): Entity[] => {
let x = 0;
Expand Down Expand Up @@ -59,6 +63,8 @@ export const generateLevel = (): Entity[] => {
// surprise
new Car(i(650)),

createEthCableObjective(i(100)),

// ghost cactuses
new GhostCactus(i(400)),
new GhostCactus(i(400)),
Expand Down Expand Up @@ -101,12 +107,15 @@ export const generateLevel = (): Entity[] => {
new GhostCactus(i(25)),
new Car(i(300)),
new Car(i(50)),
//

// jump scare
new Cactus(i(200)),
new Cactus(i(200)),
new Cactus(i(200)),
new Spider(i(150)),
new Spider(i(175)),

createModemObjective(i(200)),
createRouterObjective(i(200)),

new Cactus(i(250)),
new Cactus(i(50)),
Expand All @@ -121,6 +130,8 @@ export const generateLevel = (): Entity[] => {
new Cactus(i(125)),
new Cactus(i(125)),

createRouterObjective(i(200)),

new CactusWithGun(i(350)),
new CactusWithGun(i(350)),
new CactusWithGun(i(350)),
Expand Down

0 comments on commit 9a5032b

Please sign in to comment.