public Projectile(double pX, double pY, double velX, double velY, PhysicsSprite.PlayerType creatorId, PhysicsSprite.GlowType glowType) { this.posX = pX; this.posY = pY; this.velX = velX / 100; this.velY = velY / 100; this.creatorId = creatorId; this.glowType = glowType; ani = new Animation(Game1.Instance.gameData.animations[getGlowFlyAniIndex(glowType)]); ani.start(); }
private void reverseDirection() { //swap the creator creatorId = (creatorId == PhysicsSprite.PlayerType.Player1) ? PhysicsSprite.PlayerType.Player2 : PhysicsSprite.PlayerType.Player1; //reverse the direction velX = -velX; velY = -velY; }