Inheritance: MonoBehaviour
Beispiel #1
0
 public Coin(Texture2D texture, Rectangle rectangle, int value, CoinSoundController sound) : base(texture, rectangle)
 {
     this.value     = value;
     this.isActive  = true;
     this.animation = new ItemAnimation(texture, rectangle, 4, 1);
     this.sound     = sound;
 }
    void Start()
    {
        /*GameObject pausedMenu = GameObject.Find("PausedCanvas");
         * pausedCanvas = pausedMenu.GetComponent<Canvas>();*/
        pausedCanvas.enabled = false;
        GameObject.Find("Intro_Music_Manager").GetComponent <AudioSource>().enabled = false;

        GameObject inventory = GameObject.Find("UI");

        inventoryCanvas         = inventory.GetComponent <Canvas>();
        inventoryCanvas.enabled = true;
        numPotions         = 0;
        ingredientsEnabled = true;

        noPotionsPanel.SetActive(false);
        poweredUpPanel.SetActive(false);
        explosionIncPanel.SetActive(false);
        damageIncPanel.SetActive(false);

        poweredUp            = false;
        damageIncreased      = false;
        explosionIncreased   = false;
        queueTracker         = 0;
        catAnimation         = GameObject.Find("Button 4").GetComponent <ItemAnimation>();
        eggAnimation         = GameObject.Find("Button 5").GetComponent <ItemAnimation>();
        eggAnimation.enabled = false;
        catAnimation.enabled = false;
        disableDelay         = 0.5f;
    }
Beispiel #3
0
 public CheckPoint(Rectangle rectangle, Texture2D texture, Texture2D markedTexture) : base(texture, rectangle)
 {
     this.animation = new ItemAnimation(markedTexture, rectangle, 2, 1);
     this.rectangle = rectangle;
     this.texture   = texture;
     isChecked      = false;
     wasChecked     = false;
 }
Beispiel #4
0
 public Sprite(Vector2 position, Texture2D deathTexture) : base(null, position)
 {
     rectangle      = new Rectangle((int)position.X, (int)position.Y, 100, 100);
     velocity       = Vector2.Zero;
     jump           = false;
     lifePoints     = 100;
     isAlive        = true;
     attacking      = 0;
     deathTime      = 0;
     deathAnimation = new ItemAnimation(deathTexture, rectangle, 4, 2);
     canFly         = false;
 }
Beispiel #5
0
        public GameMaster(ContentManager content, Vector2 screenData, List <Rectangle> triggers, List <string> captions) : base(null, new Rectangle((int)(4 * (screenData.X / 5)), (int)(3 * (screenData.Y / 5)), (int)screenData.X, (int)screenData.Y))
        {
            this.screenData = screenData;

            isActive      = false;
            this.triggers = triggers;
            wasAccepted   = false;
            this.captions = captions;

            chatBox = new ChatBox(content.Load <Texture2D>("GameUI/chatBox"), rectangle, content.Load <SpriteFont>("Fonts/smallFont"));

            rectangle.X          = 4 * (rectangle.Width / 5);
            rectangle.Y          = 3 * (rectangle.Height / 5);
            rectangle.Width      = 100;
            rectangle.Height     = 100;
            this.animatedTexture = new ItemAnimation(content.Load <Texture2D>("Sprites/GameMaster"), rectangle, 3, 1);
        }
Beispiel #6
0
        public static string GetAnimationName(TRVersion.Game version, uint objectId, uint animId)
        {
            Game          game;
            ItemAnimation entry = new ItemAnimation();

            Games.TryGetValue(version.Native(), out game);

            if (game != null)
            {
                entry = game.Animations.FirstOrDefault(item => item.Item == objectId && item.Animation == animId);
            }

            if (entry.Name == null)
            {
                var otherGames = Games.Where(g => g.Key != version.Native()).ToList();
                otherGames.Reverse();

                foreach (var otherGame in otherGames)
                {
                    entry = otherGame.Value.Animations.FirstOrDefault(item => item.Item == objectId && item.Animation == animId);
                    if (entry.Name != null)
                    {
                        break;
                    }
                }
            }

            if (entry.Name == null)
            {
                return("Animation " + animId);
            }
            else
            {
                return(entry.Name);
            }
        }
Beispiel #7
0
 public Tourch(Texture2D texture, Rectangle rectangle) : base(null, rectangle)
 {
     animation   = new ItemAnimation(texture, rectangle, 2, 1);
     lightSource = new Vector2(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2);
 }