Skip to content

Commit

Permalink
Merge pull request #480 from UQdeco2800/team4-sprint4
Browse files Browse the repository at this point in the history
Team4 sprint4 - implementing Poison and Health increase animations
  • Loading branch information
prateek45 committed Oct 19, 2021
2 parents 94f834b + 0e72657 commit 58a9a50
Show file tree
Hide file tree
Showing 196 changed files with 1,459 additions and 70 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,201 changes: 1,171 additions & 30 deletions source/core/assets/images/mpc/finalAtlas/gold_2/mpcAnimation_2.atlas

Large diffs are not rendered by default.

Binary file modified source/core/assets/images/mpc/finalAtlas/gold_2/mpc_right.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void decreaseHealth(){
*/
public void poisoning() {
PlayerStatsDisplay playerComponent = this.player.getComponent(PlayerStatsDisplay.class);
//triggering player poison status
player.getEvents().trigger("poisoned");
long lasthealthdeductiontime = 0;
int counter=0;
Expand Down Expand Up @@ -84,7 +85,7 @@ public void slowSpeed() {
removeBuff_Debuff();
}

//removing buff/debuff after 1s
//removing buff/debuff after 5s

public void removeBuff_Debuff() {
Timer timer=new Timer();
Expand All @@ -94,7 +95,7 @@ public void run() {
player.getEvents().trigger("stopBuffDebuff");
timer.stop();
}
},10);
},5);
}
public void removeSlowSpeed() {
player.updateSpeed(new Vector2(4,8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void create() {
switch (obstacleType) {
case PLANTS_OBSTACLE:
entity.getEvents().addListener(COLLISION_START, this::plantsDisappear);
entity.getEvents().trigger("poison");

break;
case THORNS_OBSTACLE:
entity.getEvents().addListener(COLLISION_START, this::thornsDisappear);
Expand Down Expand Up @@ -124,7 +124,7 @@ void plantsDisappear(Fixture me, Fixture other) {
// Doesn't match our target layer, ignore
return;
}

entity.getEvents().trigger("poison");
if (count == 0) { // Avoid an entity from repeatedly triggering an attack
count++;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Timer;
import com.deco2800.game.areas.ForestGameArea;

import com.deco2800.game.components.foodAndwater.RecycleDisplay;
Expand Down Expand Up @@ -77,7 +78,9 @@ public boolean keyDown(int keycode) {
case Keys.J:
if(entity.getComponent(CombatStatsComponent.class).getHealth() < 100){
newItembar.usekit();
entity.getEvents().trigger("healthUp");
entity.getComponent(CombatStatsComponent.class).addHealth(10);
removeBuff_Debuff();
ForestGameArea.playitemMusic();
}
return true;
Expand Down Expand Up @@ -182,4 +185,18 @@ private void triggerWalkEvent() {
public Vector2 getWalkDirection() {
return walkDirection;
}

//removing buff/debuff after 1s

public void removeBuff_Debuff() {
Timer timer=new Timer();
timer.scheduleTask(new Timer.Task() {
@Override
public void run() {
entity.getEvents().trigger("stopBuffDebuff");
timer.stop();
}
},1);
}
}

Loading

0 comments on commit 58a9a50

Please sign in to comment.