public void AddShot(Vector3 position, Vector3 direction, Object owner, InteractionMediator.attackType attackType) { //Determine owner Player1 temp; if (owner == player1) temp = player1; else temp = player2; shots.Add(new Bullet( Game.Content.Load<Model>(@"models\ammo"), position, direction, temp, attackType)); }
public Bullet(Model m, Vector3 position, Vector3 Direction, Player1 owner, InteractionMediator.attackType type) : base(m) { world = Matrix.CreateTranslation(position); myPlayer = owner; myType = type; if (type == InteractionMediator.attackType.BULLET) { tint = Color.Blue; mySpeed = .9f; } else if (type == InteractionMediator.attackType.SMASHBULLET) { tint = Color.Red; mySpeed = .5f; } direction = Direction * mySpeed; }
protected override void LoadContent() { //Stage stage = new Stage1( Game.Content.Load<Model>(@"models\stage")); //Players p1 = new Player1( Game.Content.Load<Model>(@"models\pikachu_final")); ((Player1)p1).setPosition(-25); models.Add(p1); p2 = new Player2( Game.Content.Load<Model>(@"models\pikachu_final")); ((Player1)p2).setPosition(25); models.Add(p2); shield1 = new BasicModel( Game.Content.Load<Model>(@"models\pokeballmodel")); shield2 = new BasicModel( Game.Content.Load<Model>(@"models\pokeballmodel")); //Lives stock = Game.Content.Load<Texture2D>(@"textures\stock"); mediator = new InteractionMediator((Player1)p1, (Player1)p2); //Assign Mediator ((Player1)p1).mediator = mediator; ((Player1)p2).mediator = mediator; //Assign all the models this Model Manager foreach (BasicModel m in models) m.setModelManager(this); player1 = ((Player1)p1); player2 = ((Player1)p2); spriteBatch = new SpriteBatch(GraphicsDevice); percentFont = Game.Content.Load<SpriteFont>(@"fonts\menuFont"); base.LoadContent(); }