コード例 #1
0
ファイル: Zombie.cs プロジェクト: marsojm/JTZS
 public Zombie(Vector2 position, GraphicsLib graphicsLib)
 {
     this.position    = position;
     speed            = 0.9f;
     health           = 3;
     damage           = 5;
     destinationRect  = new Rectangle((int)position.X, (int)position.Y, 30, 30);
     this.graphicsLib = graphicsLib;
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: marsojm/JTZS
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     graphicsLib = new GraphicsLib(Content); // ladataan grafiikkakirjasto
     soundsLib   = new SoundsLib(Content);
     menuControl = new MenuControl(spriteBatch, soundsLib.menuSound, graphicsLib);
     popup       = new Popup(spriteBatch, graphicsLib.text, graphicsLib.popup);
     highScores  = HighScores.Load("Content/hiscores.xml");
     highScores.Sort();
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: marsojm/JTZS
 public Player(Vector2 position, GraphicsLib graphicsLib, int health)
 {
     this.position    = position;
     bSphere          = new BoundingSphere(new Vector3(position.X, position.Y, 0), 12);
     this.graphicsLib = graphicsLib;
     this.health      = health;
     defaultWeapon    = "Assault Rifle";
     currentWeapon    = defaultWeapon;
     shotInterval     = 170f;
     damage           = 1;
 }
コード例 #4
0
ファイル: MenuControl.cs プロジェクト: marsojm/JTZS
        public MenuControl(SpriteBatch spriteBatch, SoundEffect sEffect, GraphicsLib graphicsLib)
        {
            this.graphicsLib = graphicsLib;
            Color baseColor     = Color.Brown;
            Color selectedColor = Color.Red;

            this.spriteBatch = spriteBatch;
            this.font        = graphicsLib.text;
            menuSound        = sEffect;

            menu[0] = new Menu("Play", "Play", font, new Vector2(50f, 100f), baseColor, selectedColor, true);
            menu[1] = new Menu("HighScores", "High Scores", font, new Vector2(50f, 150f), baseColor, selectedColor, false);
            menu[2] = new Menu("Help", "Help", font, new Vector2(50f, 200f), baseColor, selectedColor, false);
            menu[3] = new Menu("Quit", "Quit", font, new Vector2(50f, 250f), baseColor, selectedColor, false);
        }
コード例 #5
0
ファイル: Rifle.cs プロジェクト: marsojm/JTZS
 public Rifle(Vector2 position, GraphicsLib graphicsLib)
 {
     this.position    = position;
     this.graphicsLib = graphicsLib;
     itemName         = "Rifle";
 }
コード例 #6
0
 public Bullet(Vector2 position, Vector2 direction, GraphicsLib graphicsLib)
 {
     this.graphicsLib = graphicsLib;
     this.position    = position;
     this.direction   = direction;
 }
コード例 #7
0
ファイル: Machinegun.cs プロジェクト: marsojm/JTZS
 public Machinegun(Vector2 position, GraphicsLib graphicsLib)
 {
     this.position    = position;
     this.graphicsLib = graphicsLib;
     itemName         = "Machinegun";
 }
コード例 #8
0
ファイル: MedKit.cs プロジェクト: marsojm/JTZS
 public MedKit(Vector2 position, GraphicsLib graphicsLib)
 {
     this.position    = position;
     this.graphicsLib = graphicsLib;
     itemName         = "MedKit";
 }