コード例 #1
0
ファイル: Enemy.cs プロジェクト: bradenwatling/Shooter
 public EnemySpawn(LineBatch lineBatch, Level level, Player player)
 {
     this.lineBatch = lineBatch;
     this.level = level;
     this.player = player;
     this.random = new Random();
     this.timer = new Timer(this.random.Next(SPIDER_MAX_DELAY));
     spiders = new List<Spider>();
     zombies = new List<Zombie>();
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: bradenwatling/Shooter
        public Player(LineBatch lineBatch, Level level, Vector2 position)
        {
            this.lineBatch = lineBatch;
            this.level = level;
            this.position = position;

            this.bow = new Bow(this.lineBatch, position + leftHand);

            this.yVelocity = 0;
            this.moveValue = 0;

            this.health = MAX_HEALTH;

            this.jumpDelay = new Timer(JUMP_DELAY);
        }
コード例 #3
0
ファイル: Bow.cs プロジェクト: bradenwatling/Shooter
        public Bow(LineBatch lineBatch, Vector2 position)
        {
            this.lineBatch = lineBatch;

            this.curve = new Curve();
            this.curve.Keys.Add(new CurveKey(0, 0));
            this.curve.Keys.Add(new CurveKey(BOW_HEIGHT / 2, BOW_WIDTH));
            this.curve.Keys.Add(new CurveKey(BOW_HEIGHT, 0));

            this.timer = new Timer(SHOOT_DELAY);

            this.arrows = new List<Arrow>();

            this.position = position;

            this.arrowPower = 0;
            this.mousePressed = false;
        }