コード例 #1
0
ファイル: Shark.cs プロジェクト: flair2005/DeepSeaAdventure
        public Shark(Texture2D tex, Vector2 centre, Vector2 pos, Rectangle sourceRect, Vector2 vel, geraldLevelOne food) :
            base(tex, centre, pos, sourceRect, vel)
        {
            // Pass the player as a parameter so the shark can track the movement.
            this.food = food;

        }
コード例 #2
0
        public override void LoadContent()
        {
            // Load Sounds
            soundManager.Instance.LoadSound("Applause");
            soundManager.Instance.LoadSound("SadTrombone");
            soundManager.Instance.LoadSound("Pop Cork");
            soundManager.Instance.LoadSound("Jaws");

            textureManager.Instance.LoadTexture("Underwater");
            textureManager.Instance.LoadTexture("Goldfish");
            textureManager.Instance.LoadTexture("Shark");
            textureManager.Instance.LoadTexture("pellets");

            // Assign All Sounds

            sharkAmbient = soundManager.Instance.getInstance("Jaws");

            // Assign texture to variable
            backgroundTex = textureManager.Instance.useTexture("Underwater");
            geraldTexture = textureManager.Instance.useTexture("Goldfish");
            pelletTexture = textureManager.Instance.useTexture("pellets");
            sharkTexture  = textureManager.Instance.useTexture("Shark");

            // Load up all gameObjects
            Gerald = new geraldLevelOne(geraldTexture,
                                        new Vector2(geraldTexture.Width / 2, geraldTexture.Height / 2),
                                        new Vector2(300, 100),
                                        new Rectangle(0, 0, geraldTexture.Width, geraldTexture.Height),
                                        new Vector2(8, 8));
            levelObjects.Add(Gerald);

            Jaws = new Shark(sharkTexture,
                             new Vector2(sharkTexture.Width / 2, sharkTexture.Height / 2),
                             new Vector2(-100, 100),
                             new Rectangle(0, 0, sharkTexture.Width, sharkTexture.Height),
                             new Vector2(0.1f, 0.1f), Gerald);

            kootenayFont = theGame.Content.Load <SpriteFont>("Fonts\\Kootenay");
        }
コード例 #3
0
        public override void LoadContent()
        {
            // Load Sounds
            soundManager.Instance.LoadSound("Applause");
            soundManager.Instance.LoadSound("SadTrombone");
            soundManager.Instance.LoadSound("Pop Cork");
            soundManager.Instance.LoadSound("Jaws");

            textureManager.Instance.LoadTexture("Underwater");
            textureManager.Instance.LoadTexture("Goldfish");
            textureManager.Instance.LoadTexture("Shark");
            textureManager.Instance.LoadTexture("pellets");

            // Assign All Sounds

            sharkAmbient = soundManager.Instance.getInstance("Jaws");

            // Assign texture to variable
            backgroundTex = textureManager.Instance.useTexture("Underwater");
            geraldTexture = textureManager.Instance.useTexture("Goldfish");
            pelletTexture = textureManager.Instance.useTexture("pellets");
            sharkTexture = textureManager.Instance.useTexture("Shark");

            // Load up all gameObjects
            Gerald = new geraldLevelOne(geraldTexture,
                new Vector2(geraldTexture.Width/2, geraldTexture.Height/2),
                new Vector2(300,100),
                new Rectangle(0,0, geraldTexture.Width, geraldTexture.Height),
                new Vector2(8,8));
            levelObjects.Add(Gerald);

            Jaws = new Shark(sharkTexture,
                new Vector2(sharkTexture.Width / 2, sharkTexture.Height / 2),
                new Vector2(-100, 100),
                new Rectangle(0, 0, sharkTexture.Width, sharkTexture.Height),
                new Vector2(0.1f, 0.1f), Gerald);         

            kootenayFont = theGame.Content.Load<SpriteFont>("Fonts\\Kootenay");
        }
コード例 #4
0
 public Shark(Texture2D tex, Vector2 centre, Vector2 pos, Rectangle sourceRect, Vector2 vel, geraldLevelOne food) :
     base(tex, centre, pos, sourceRect, vel)
 {
     // Pass the player as a parameter so the shark can track the movement.
     this.food = food;
 }