コード例 #1
0
ファイル: Character.cs プロジェクト: grodranlorth/tctk
        public Character(string textureName, Vector2 position, ContentManager content, int frameCount)
        {
            mContent = content;
            mTextureName = textureName;
            mPosition = position;
            mAge = age.BABY;
            mStates = states.SPAWNING;
            mSpeed = new Vector2(1.0f, 0.25f);
            //mSpeed = new Vector2(0, 0);

            mSprite = new AnimatedSprite();
            //mSprite.Load(mContent, "AnimatedSprites/" + mTextureName, frameCount, 30, 149, 139, false);
            mSprite.Load(mContent, "AnimatedSprites/" + mTextureName, frameCount, 0.125f, 128, 128, false);

            bSphere = new BoundingSphere(new Vector3(position.X + mSprite.getWidth() / 2, position.Y + mSprite.getHeight() / 2, 0), mSprite.getWidth() / 2);
            distance = 10000;
            destination = Vector2.Zero;
            timeEating = 2.0f;

            timeOnFire = 0.5f;

            respawnRate = 3.0f;
            remove = false;
            multipleOfTwo = false;
            hacktex = Class1.CreateCircle((int)mSprite.getWidth() / 2, Color.Yellow);

            timespawning = 2.0f;
        }
コード例 #2
0
ファイル: Menu.cs プロジェクト: grodranlorth/tctk
        public Button(Game g, ContentManager cm, string texname, string tname, float x,
            float y, int fc, float fps, float width, float height, bool once, string s)
        {
            mSprite = new AnimatedSprite();
            mSprite.Load(cm, tname, fc, fps, width, height, once);

            mTex = cm.Load<Texture2D>(texname);
            mTexscale = 0.5f;
            mpos = new Vector2(x, y);

            rect = new Rectangle(g.GraphicsDevice.Viewport.Width / 10, (g.GraphicsDevice.Viewport.Height) - 350, mTex.Width, mTex.Height);
            name = s;

            mover = false;
            moshrink = 1;
        }
コード例 #3
0
ファイル: Menu.cs プロジェクト: billyboy429/tctk
        public void Load(ContentManager content)
        {
            mState = states.TITLE;

            backUnsel = content.Load<Texture2D>("Menu/backbutton");
            creditsUnsel = content.Load<Texture2D>("Menu/creditsbutton");
            helpUnsel = content.Load<Texture2D>("Menu/helpbutton");
            startUnsel = content.Load<Texture2D>("Menu/startbutton");

            backSel = new AnimatedSprite();
            creditsSel = new AnimatedSprite();
            helpSel = new AnimatedSprite();
            startSel = new AnimatedSprite();

            backSel.Load(content, "backbuttonspritesheet", 8, 0.05f, 435.75, 193, false);
            creditsSel.Load(content, "creditsbuttonspritesheet", 8, 0.05f, 435.75, 193, false);
            helpSel.Load(content, "helpbuttonspritesheet", 8, 0.05f, 435.75, 193, false);
            startSel.Load(content, "startbuttonspritesheet", 8, 0.05f, 435.75, 193, false);

            menuScreen = content.Load<Texture2D>("Menu/menubackground");
            title = content.Load<Texture2D>("Menu/logo");

            credits = content.Load<Texture2D>("Menu/credits");
            help = content.Load<Texture2D>("Menu/help");

            startRect = new Rectangle(g.GraphicsDevice.Viewport.Width / 10, (g.GraphicsDevice.Viewport.Height) - 350, startUnsel.Width, startUnsel.Height);
            instructRect = new Rectangle(g.GraphicsDevice.Viewport.Width / 8, (g.GraphicsDevice.Viewport.Height) - 250, helpUnsel.Width, helpUnsel.Height);
            creditRect = new Rectangle(g.GraphicsDevice.Viewport.Width / 6, (g.GraphicsDevice.Viewport.Height) - 150, creditsUnsel.Width, creditsUnsel.Height);
            backRect = new Rectangle(g.GraphicsDevice.Viewport.Width - 550, (g.GraphicsDevice.Viewport.Height) - 150, backUnsel.Width, backUnsel.Height);
        }
コード例 #4
0
ファイル: Weapon.cs プロジェクト: billyboy429/tctk
        public WHeart(ContentManager cm, GraphicsDeviceManager graphics)
            : base(cm, graphics)
        {
            mYValue = 0.0f;
            mPos = new Vector2();
            mState = states.GONE;

            mSprite = new AnimatedSprite();
            mSprite.Load(cm, "Weapons/bombheart", 6, .5f);
        }
コード例 #5
0
ファイル: Weapon.cs プロジェクト: grodranlorth/tctk
        public WHeart(ContentManager cm, GraphicsDeviceManager graphics)
            : base(cm, graphics)
        {
            mPos = new Vector2();
            mState = states.GONE;

            mSprite = new AnimatedSprite();
            mSprite.Load(cm, "Weapons/bombheart", 6, .5f, 117.6f, 100, false);

            mSpriteExp = new AnimatedSprite();
            mSpriteExp.Load(cm, "AnimatedSprites/mushroomspritesheet", 12, .02f, 118, 127, false);
            mSpriteExp.Scale = 1.25f;
        }