コード例 #1
0
        public Sprite_Table(string name, string textureImage, string glowImage, string grab_sound, AssetManager assetManager,
            Vector2 position, int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed, int millisecondsPerFrame)
            : base(assetManager.GetTextures(textureImage), position,
            new Point(assetManager.GetTextures(textureImage).Width, assetManager.GetTextures(textureImage).Height),
            collisionOffset, currentFrame, sheetSize, speed, 0, null)
        {
            this.assetManager = assetManager;

            this.textureImage = assetManager.GetTextures(textureImage);
            this.regularImage = assetManager.GetTextures(textureImage);
            this.glowImage = assetManager.GetTextures(glowImage);

            this.grab_sound = assetManager.GetSounds(grab_sound);
            this.name = name;
        }
コード例 #2
0
        //bubble
        //we use bubble as our "active" sprite
        public Sprite_Customer(string name, CustomerAsset asset, AssetManager assetManager, int level,
            int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed,
            int millisecondsPerFrame, SoundEffect collision_sound)
            : base(assetManager.GetTextures(asset.Bubble_file), asset.vBubble,
            new Point(assetManager.GetTextures(asset.Bubble_file).Width, assetManager.GetTextures(asset.Bubble_file).Height),
            collisionOffset, currentFrame, sheetSize, speed, 0, collision_sound)
        {
            this.name = name;
            this.asset = asset;
            this.assetManager = assetManager;
            this.level = level;
            this.my_customer = new Customer(this.Order(), level);

            //we use this because assets require scaling....
            RECT_CUSTOMER.X = (int)asset.vCustomer.X;
            RECT_CUSTOMER.Y = (int)asset.vCustomer.Y;
            RECT_ORDER.X = (int)asset.vOrder.X;
            RECT_ORDER.Y = (int)asset.vOrder.Y;
            RECT_BUBBLE.X = (int)asset.vBubble.X;
            RECT_BUBBLE.Y = (int)asset.vBubble.Y;
        }