/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize () { base.Initialize (); this.graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width; this.graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height; this.graphics.IsFullScreen = false; this.graphics.ApplyChanges (); this.IsMouseVisible = true; this.status = new Status (); this.world = new World (this); this.ui = new UI (this); this.start = new Rectangle(Window.ClientBounds.Width - 300, Window.ClientBounds.Height - 102, 280, 82); this.tutorial = new Rectangle(10, Window.ClientBounds.Height - 102, 280, 82); int res1rx = (int)(Window.ClientBounds.Right - font.MeasureString(res1).X - 25); int res1ry = (int)(Window.ClientBounds.Top + 25); int res1w = (int)(font.MeasureString(res1).X); int res1h = (int)(font.MeasureString(res1).Y); this.res1R = new Rectangle(res1rx, res1ry, res1w, res1h); this.res2R = new Rectangle(res1rx, res1ry + res1h, res1w, res1h); this.res3R = new Rectangle(res1rx, res1ry + res1h * 2, res1w, res1h); }
public Tower(World world, Rectangle towerBase) { this.world = world; this.towerBase = towerBase; this.center = new Vector2 (towerBase.Width / 2 + towerBase.X, towerBase.Height / 2 + towerBase.Y); }
public Base(World world, Rectangle area) { this.world = world; this.area = area; this.currentHealth = 20; this.maxHealth = 20; }
public Base(World world, Crossroad lc) { this.world = world; this.area = lc.Area; this.currentHealth = 20; this.maxHealth = 20; last = lc; }
public Projectile(World world, Vector2 position, Unit target, int dmg, float speed, int imprecision) { this.world = world; this.targetFocused = target; this.position = position; this.damage = dmg; this.currentSpeed = speed; this.imprecision = imprecision; // this.texProjectile = world.texArrow; }
public Arrow(World world, Vector2 position, Unit target, int dmg, float speed, int imprecision) : base(world, position, target, dmg, speed, imprecision) { texProjectile = world.TexArrow; hitAnimation = KLinuxDefense.AnimationType.RED_PUFF; missAnimation = KLinuxDefense.AnimationType.DIRT_PUFF; SetupProjectileSize(); CalculateMovement(); }
public Bullet(World world, Vector2 position, Unit target, int dmg, float speed, int imprecision) : base(world, position, target, dmg, speed, imprecision) { texProjectile = world.TexBullet; missAnimation = KLinuxDefense.AnimationType.DIRT_PUFF; hitAnimation = KLinuxDefense.AnimationType.RED_PUFF; additive = true; scale = 0.4f; dType = KLinuxDefense.DamageType.PIERCE; color = new Color(255, 150, 150, 255); CalculateMovement(); SetupProjectileSize(); }
public RifleTower(World world, Rectangle towerBase) : base(world, towerBase) { textureMM = world.TexMMrifle; fireSound = "rifle"; name = "rifle tower"; texture = world.TexTowerRifle; firingRate = 700.0f; currentDamage = 30; currentRange = 225; imprecision = 1; projectileSpeed = 18; mmColor = Color.Green; defaultRange = currentRange; defaultFiringRate = firingRate; defaultDamage = currentDamage; baseDamage = defaultDamage; cost = 10; SetDrawRectangle(); }
public void Restart () { this.status = new Status (); this.world = new World (this); this.ui = new UI (this); }