public Projectile(Game game, Player player ,Vector2 startingPosition, float angle) { this.player = player; this.angle = angle; this.game = game; this.damage = 300; position = startingPosition; velocity = new Vector2((float)Math.Cos((double)angle), (float)Math.Sin((double)angle)); velocity.Normalize(); velocity *= MoveSpeed; LoadContent(); }
protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); hudFont = Content.Load<SpriteFont>("Fonts/Hud"); //this.Content.Load<Texture2D>("Sprites/Zombie/ZombieIdle"); //this.Content.Load<Texture2D>("Sprites/Zombie/ZombieAttack"); //this.Content.Load<Texture2D>("Sprites/Player/PlayerIdle"); //this.Content.Load<Texture2D>("Sprites/Player/PlayerShoot"); this.Content.Load<Texture2D>("Sprites/Projectiles/Default"); this.Content.Load<Texture2D>("Sprites/Other/Crosshair"); this.Content.Load<Texture2D>("Tiles/Ground"); this.Content.Load<Texture2D>("Tiles/Wall"); //this.Content.Load<SoundEffect>; screenCenter.X = graphics.GraphicsDevice.Viewport.Width / 2; screenCenter.Y = graphics.GraphicsDevice.Viewport.Height / 2; LoadMap("test"); player = new Player(this); //zombies = new List<Zombie>(); projectileManager = new ProjectileManager(this); random = new Random(); //for (int zombie = 0; zombie < 10; zombie++) //{ // zombies.Add(new Zombie(this, random)); //} crosshair = map.Content.Load<Texture2D>("Sprites/Other/Crosshair"); }
public bool canSee(Player player) { //Rectangle view = new Rectangle() //if() return true; }
public void ReactTo(Player player, ref AIParameters AIparams ) { if (player != null) { } }
public void CreateProjectile(Vector2 position, float angle,Player player) { var projectile = new Projectile(game, player, position, angle); projectiles.Add(projectile); }