public Sword() : base(null, new Point(), new Vector2()) { this.gravity = new Gravity(this); this.gravity.ChangeGravityIntensity(1.0f); this.SpriteFactory = EffectsFactory.GetInstance(); this.SwordState = new ReadyToSwingState(this); this.hitboxOffset = 0; }
public void Setup() { FireMarioFactory.GetInstance().ChangeTexture(_costumes[Index].MarioTexture); Mario.GetInstance().UpdateActionSprite(); ItemFactory.GetInstance().ChangeTexture(_costumes[Index].ItemTexture); Mario.GetInstance().GravityIntensity = _costumes[Index].MarioGravityIntensity; Mario.GetInstance().UpdateFireballsAndSword(_costumes[Index].ProjectileNum, _costumes[Index].ProjectileGravity, _costumes[Index].ProjectileYBounceSpeed, _costumes[Index].ProjectileInitXSpeed, _costumes[Index].ProjectileInitYSpeed, _costumes[Index].HasSword, _costumes[Index].SwordGravity); EffectsFactory.GetInstance().ChangeTexture(_costumes[Index].EffectsTexture); }
public PortalProjectile(bool left) : base(EffectsFactory.GetInstance(), Mario.GetInstance().GetCenter(), new Vector2()) { Systems.Events.TheInstance.PortalProjectileFiring(); double angle = MouseController.DetermineAngleFromMouse(Mario.GetInstance().GetCenter()); this.XSpeed = (int)(SPEED * Math.Cos(angle)); this.YSpeed = (int)(SPEED * Math.Sin(angle)); this.left = left; if (this.left) { this.sprite = this.spriteFactory.CreateProduct(EffectTypes.BluePortalProjectile); } else { this.sprite = this.spriteFactory.CreateProduct(EffectTypes.OrangePortalProjectile); } MarioGame.GetInstance.AddNewGameObject(false, this); }