Skip to content

Commit

Permalink
Made pointlights dissapear with character when ascending. Fixed bot n…
Browse files Browse the repository at this point in the history
…umber in lobby.
  • Loading branch information
Praccen committed Oct 2, 2023
1 parent 27d1ec6 commit 7e526e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions code/src/Game/OpponentCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default class OpponentCharacter extends Character {
character_specific_accended_operations(dt) {
// this.allCharacterDict["bots"].remove(this.bot_number);
this.ecsManager.removeEntity(this.bodyEntity.id);
this.ecsManager.removeEntity(this.fireEntity.id);
}

accend() {
Expand Down
5 changes: 1 addition & 4 deletions code/src/Game/PlayerCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export default class PlayerCharacter extends Character {
}

character_specific_accended_operations(dt) {
let particleSpawnerComp = this.fireEntity.getComponent(
ComponentTypeEnum.PARTICLESPAWNER
) as ParticleSpawnerComponent;
particleSpawnerComp.destructor();
this.ecsManager.removeEntity(this.fireEntity.id);
this.ecsManager.removeEntity(this.bodyEntity.id);
}

Expand Down
6 changes: 4 additions & 2 deletions code/src/Game/States/LobbyState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class LobbyState extends State {
this.addBotButton.position.y = 0.7;
this.addBotButton.textString = "Add bot";
this.addBotButton.onClick(() => {
this.addParticipant("Bot " + Game.getInstanceNoSa().num_bots++);
this.addParticipant("Bot " + Game.getInstanceNoSa().num_bots);
});

this.removeParticipantButton = this.overlay.getNewButton();
Expand All @@ -86,19 +86,21 @@ export default class LobbyState extends State {
if (length > 2) {
this.participantsDiv.children[length - 1].remove();
this.participantsDiv.children.pop();
Game.getInstanceNoSa().num_bots--;
Game.getInstanceNoSa().num_bots = this.participantsDiv.children.length - 2;
}
});
}

private addParticipant(name: string) {
let participantText = this.overlay.getNew2DText(this.participantsDiv);
participantText.textString = name;
Game.getInstanceNoSa().num_bots = this.participantsDiv.children.length - 2;
}

async init() {
super.init();
this.overlay.show();
Game.getInstanceNoSa().num_bots = this.participantsDiv.children.length - 2;
}

reset() {
Expand Down

0 comments on commit 7e526e1

Please sign in to comment.