-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Team-1--Mobs-Enhancement' of https://github.com/UQcsse3…
…200/2023-studio-3 into Team-1--Mobs-Enhancement
- Loading branch information
Showing
10 changed files
with
426 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
source/core/src/main/com/csse3200/game/components/tasks/bosstask/PatrickDeathTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.csse3200.game.components.tasks.bosstask; | ||
|
||
import com.badlogic.gdx.math.Vector2; | ||
import com.badlogic.gdx.utils.Timer; | ||
import com.csse3200.game.ai.tasks.DefaultTask; | ||
import com.csse3200.game.ai.tasks.PriorityTask; | ||
import com.csse3200.game.entities.Entity; | ||
import com.csse3200.game.entities.factories.MobBossFactory; | ||
import com.csse3200.game.rendering.AnimationRenderComponent; | ||
import com.csse3200.game.services.ServiceLocator; | ||
|
||
public class PatrickDeathTask extends DefaultTask implements PriorityTask { | ||
|
||
private boolean startFlag = false; | ||
private static final int PRIORITY = 3; | ||
|
||
/** | ||
* What is run when patrick's death task is assigned | ||
*/ | ||
@Override | ||
public void start() { | ||
super.start(); | ||
startFlag = true; | ||
owner.getEntity().getEvents().trigger("patrick_death"); | ||
} | ||
|
||
/** | ||
* What is run every frame | ||
*/ | ||
@Override | ||
public void update() { | ||
if (startFlag && owner.getEntity().getComponent(AnimationRenderComponent.class). | ||
isFinished()) { | ||
owner.getEntity().setFlagForDelete(true); | ||
} | ||
} | ||
|
||
/** | ||
* @return priority of task | ||
*/ | ||
@Override | ||
public int getPriority() { | ||
return PRIORITY; | ||
} | ||
} |
Oops, something went wrong.