Skip to content

Commit

Permalink
box boy buffed
Browse files Browse the repository at this point in the history
  • Loading branch information
gregchan550 committed Sep 22, 2023
1 parent 868907a commit d47e7c2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.csse3200.game.components.Component;
import com.csse3200.game.components.ProjectileEffects;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.ProjectileFactory;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.components.PhysicsComponent;
import com.csse3200.game.services.ServiceLocator;

Expand Down Expand Up @@ -67,5 +71,11 @@ void stopWalking() {
void attack() {
Sound attackSound = ServiceLocator.getResourceService().getAsset("sounds/Impact4.ogg", Sound.class);
attackSound.play();
Entity projectile = ProjectileFactory.createEffectProjectile(PhysicsLayer.NPC,
new Vector2(20f, entity.getPosition().y), new Vector2(2, 2),
ProjectileEffects.BURN, false);
projectile.setPosition(entity.getPosition().x, entity.getPosition().y);
projectile.setScale(1f, 1f);
ServiceLocator.getEntityService().register(projectile);
}
}

0 comments on commit d47e7c2

Please sign in to comment.