[READ-ONLY] Mirror of https://github.com/flo-bit/shadow-shmup. Fun and casual top-down, roguelike shoot 'em up browsergame with shadow elements and colorful neon effects flo-bit.dev/shadow-shmup/
browsergame pixijs rapier2d roguelike shoot-em-up typescript webgame
0

Configure Feed

Select the types of activity you want to include in your feed.

sounds

Florian (Aug 4, 2024, 10:17 AM +0200) 46a951bf 29b913dc

+35 -48
+1 -1
Readme.md
··· 30 30 - [ ] show stats at end of game 31 31 - [ ] tutorial 32 32 - [ ] move wave counter to top right corner 33 - - [ ] 33 + - [ ] pentagon enemies: make bullets pentagon shaped and slowly rotating (and some kind of warning?) 34 34 - [ ] different players 35 35 - [ ] different weapons 36 36 - [ ] different shapes
public/sounds/coin.mp3

This is a binary file and will not be displayed.

public/sounds/enemy-exploding.mp3

This is a binary file and will not be displayed.

public/sounds/enemy-hit.mp3

This is a binary file and will not be displayed.

public/sounds/enemy-shooting.mp3

This is a binary file and will not be displayed.

public/sounds/gun-shoot.mp3

This is a binary file and will not be displayed.

public/sounds/player-dying.mp3

This is a binary file and will not be displayed.

public/sounds/player-hit.mp3

This is a binary file and will not be displayed.

+17 -7
src/app.ts
··· 86 86 this.lightManager = new LightManager(this); 87 87 this.upgradeManager = new UpgradeManager(this); 88 88 89 + this.loadSounds(); 90 + } 91 + 92 + loadSounds() { 89 93 sound.add('music-intro', { 90 94 url: './music-intro.mp3', 91 95 volume: 0.3 ··· 98 102 99 103 sound.add('shmup-solo', { url: './shmup-solo.mp3', volume: 0.5 }); 100 104 sound.add('shmup-coop', { url: './shmup-coop.mp3', volume: 0.5 }); 101 - sound.add('coin', { url: './coin.mp3', volume: 0.1 }); 105 + // sound.add('coin', { url: './coin.mp3', volume: 0.1 }); 106 + 107 + // new sounds 108 + sound.add('gun-shoot', { url: './sounds/gun-shoot.mp3', volume: 0.2 }); 109 + sound.add('player-hit', { url: './sounds/player-hit.mp3', volume: 0.7 }); 110 + sound.add('player-dying', { url: './sounds/player-dying.mp3', volume: 0.3 }); 111 + 112 + sound.add('coin', { url: './sounds/coin.mp3', volume: 0.2 }); 113 + 114 + sound.add('enemy-hit', { url: './sounds/enemy-hit.mp3', volume: 0.1 }); 115 + sound.add('enemy-exploding', { url: './sounds/enemy-exploding.mp3', volume: 0.2 }); 116 + sound.add('enemy-shooting', { url: './sounds/enemy-shooting.mp3', volume: 0.07 }); 102 117 } 103 118 104 119 async setupPhysicsWorld() { ··· 326 341 this.spawnParticles(weapon.x, weapon.y, 50, weapon.color); 327 342 328 343 enemy.takeDamage(weapon.damage); 329 - 330 - console.log('enemy hit'); 331 344 } 332 345 333 346 if (enemy && player && enemy.hitPlayer) { ··· 339 352 340 353 player.takeDamage(projectile.damage); 341 354 projectile.destroy(); 342 - 343 - sound.play('shmup-solo'); 344 355 } 345 356 346 357 if (player && item) { 347 358 item.pickup(player); 348 359 349 - // sound.play('coin'); 360 + sound.play('coin'); 350 361 } 351 362 352 363 if (projectile) { ··· 356 367 } 357 368 358 369 spawnParticles(x: number, y: number, num: number, color: number = 0xffffff) { 359 - console.log('spawn particles', x, y, num, color); 360 370 for (let i = 0; i < num; i++) { 361 371 this.particleSystem?.createParticle( 362 372 x,
+10 -13
src/enemy.ts
··· 281 281 this.destroy(); 282 282 } 283 283 284 - sound.play('hit'); 284 + sound.play('enemy-hit'); 285 285 } 286 286 } 287 287 ··· 312 312 projectileSize: 4, 313 313 lifetime: 300, 314 314 damage: 5, 315 - showParticles: true 315 + showParticles: true, 316 + sound: false 316 317 }); 317 318 318 319 this.createIndicator(); ··· 321 322 } 322 323 323 324 async createIndicator() { 324 - const texture = await PIXI.Assets.load('./light.png'); 325 - 326 - // this.indicator = PIXI.Sprite.from(texture); 327 - // this.indicator.anchor.set(0.5); 328 - // this.indicator.scale.set(0.0); 329 - // this.indicator.alpha = 0.5; 330 - // this.indicator.tint = this.color; 331 - // this.indicator.zIndex = -10; 332 - 333 325 this.indicator = new PIXI.Graphics() 334 326 .circle(0, 0, this.size + this.shootingDistance) 335 327 .stroke({ color: this.color, width: 5 }); ··· 360 352 this.shooting = false; 361 353 362 354 this.indicator?.scale.set(0); 355 + 356 + sound.play('enemy-exploding'); 363 357 } 364 358 365 359 if (distance < 150 && this.cooldown <= 0) { ··· 492 486 fireRate: 5000, 493 487 projectileSize: 12, 494 488 damage: 10, 495 - lifetime: 4000 489 + lifetime: 4000, 490 + sound: false 496 491 }); 497 492 498 493 this.speed = 900; ··· 566 561 567 562 attack(deltaTime: number, nearestPlayer: Player, dx: number, dy: number, distance: number): void { 568 563 if (distance < 400) { 569 - this.weapon.fire(this.position, nearestPlayer.position); 564 + if (this.weapon.fire(this.position, nearestPlayer.position)) { 565 + sound.play('enemy-shooting'); 566 + } 570 567 } 571 568 572 569 this.weapon.update(deltaTime);
+3 -26
src/player.ts
··· 7 7 import Eye from './eye.js'; 8 8 import { Light } from './light.js'; 9 9 import { blendColors } from './helper.js'; 10 - import { BallWeapon } from './weapons/ball.js'; 11 10 import { Weapon } from './weapons/weapon.js'; 12 - import { Knife } from './weapons/knife.js'; 13 - import { BurstWeapon } from './weapons/burst.js'; 11 + import { sound } from '@pixi/sound'; 14 12 15 - /** 16 - * Player class 17 - * 18 - * @export 19 - * @class Player 20 - */ 21 13 export default class Player { 22 14 game: Game; 23 15 ··· 109 101 110 102 this.x = 0; 111 103 this.y = 0; 112 - 113 - // for (let i = 0; i < 5; i++) { 114 - // let ball = new BallWeapon(this.game, this.color); 115 - // ball.distance = 100 + i * 50; 116 - // ball.angle = (Math.PI * 2 * i) / 20; 117 - // ball.speed *= i * 0.1 + 2; 118 - // this.weapons.push(ball); 119 - 120 - // let knife = new Knife(this.game, this.color); 121 - // knife.distance = 200; 122 - // knife.angle = (Math.PI * 2 * i) / 5; 123 - // this.weapons.push(knife); 124 - // } 125 - // this.weapons.push(new BurstWeapon(this.game, this.color)); 126 - 127 - //this.weapons = []; 128 - //this.weapons = [new BallWeapon(this.game, this.color), new Knife(this.game, this.color)]; 129 104 } 130 105 131 106 set health(value: number) { ··· 291 266 if (this.dead) return; 292 267 293 268 this.health -= amount; 269 + 270 + sound.play('player-hit'); 294 271 295 272 this.game.controls.rumble(this.num, (amount / this._maxHealth) * 50); 296 273
+4 -1
src/weapons/gun.ts
··· 88 88 }); 89 89 this.cooldown = this.fireRate; 90 90 91 - if (this.sound) sound.play('laser'); 91 + if (this.sound) sound.play('gun-shoot'); 92 + 93 + return true; 92 94 } 95 + return false; 93 96 } 94 97 95 98 update(deltaTime: number) {