File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ export class Game {
22
22
document . body . appendChild ( this . app . canvas )
23
23
24
24
const monsters = [
25
- new Bigfoot ( this . app ) ,
25
+ new Bigfoot ( this . app , 1026 ) ,
26
26
new Bigfoot ( this . app ) ,
27
27
]
28
28
29
29
this . monsterManager = new MonsterManager ( this . app , monsters )
30
30
this . likeEventManager = new LikeEventManager ( this . app , this . monsterManager )
31
31
32
- const socket = io ( 'http://localhost:3000?u=tbell112 ' )
32
+ const socket = io ( 'http://localhost:3000?u=live_arcade_ ' )
33
33
34
34
socket . on ( 'connect' , ( ) => {
35
35
console . log ( 'Connected to server' )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export class HealthBar {
28
28
this . healthBar . rect ( 0 , 0 , 200 , 24 )
29
29
this . healthBar . fill ( 0x00CC00 )
30
30
this . healthBar . x = initialX
31
+ this . healthBar . scale . x = Math . max ( monster . getHealthPercentage ( ) , 0 )
31
32
this . healthBar . y = initialY
32
33
this . container . addChild ( this . healthBar )
33
34
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ export class Monster extends EventEmitter {
15
15
16
16
constructor ( app : PIXI . Application ) {
17
17
super ( )
18
- this . damageTaken = 0
19
18
this . killed = false
20
19
this . app = app
21
20
}
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import * as PIXI from 'pixi.js'
2
2
import { Monster } from '../monster'
3
3
4
4
export class Bigfoot extends Monster {
5
- constructor ( app : PIXI . Application ) {
5
+ constructor ( app : PIXI . Application , startHealth ?: number ) {
6
6
super ( app )
7
7
this . name = 'Bigfoot'
8
- this . hp = 200
8
+ this . hp = 10000
9
+ this . damageTaken = startHealth ?? 0
9
10
this . sprites = {
10
11
idle : './sprites/bigfoot/idle.json' ,
11
12
die : './sprites/bigfoot/die.json' ,
You can’t perform that action at this time.
0 commit comments