Example #1
0
        public HUDRenderable(
            int renderPriority,
            string playerName, int gamePadIndex,                          // player identification
            float health, float maxHealth, float energy, float maxEnergy, // displayed in bars
            int lives, int frozen,                                        // displayed as text
            Vector3 color1, Vector3 color2                                // player color specifices
            )
        {
            // initialize variables
            this.renderPriority = renderPriority;
            this.playerName     = playerName;
            this.gamePadIndex   = gamePadIndex;
            this.health         = health;
            this.maxHealth      = maxHealth;
            this.energy         = energy;
            this.maxEnergy      = maxEnergy;
            this.frozen         = frozen;
            this.lives          = lives;
            this.color1         = color1;
            this.color2         = color2;
            lastFrameTime       = currentFrameTime = 0.0;

            displayedEnergy = energy;
            displayedHealth = health;

            // FIXME: tune blinking strength here. maybe use a configuration file?
            // replace 0.55f by whatever strength is needed and 25.0f with the interval
            healthBlinkState = new SineFloat(0.0f, 0.7f, 25.0f);
            energyBlinkState = new SineFloat(0.0f, 0.7f, 25.0f);

            frozenColorStrength  = new SineFloat(0.0f, 0.85f, 5.0f);
            statusColorStrength  = new SineFloat(0.6f, 1.0f, 13.0f);
            powerupPickupDetails = new List <PowerupPickupDetails>();
        }
Example #2
0
 public ItemizedMenuScreen(Menu menu) :
     base(menu, new Vector2(640, 360))
 {
     //this.width = width;
     selectedSize   = new SineFloat(0.7f, 0.9f, 10.0f);
     unselectedSize = new SineFloat(0.48f, 0.52f, 3.0f);
     selectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds);
     unselectedSize.Start(Game.Instance.GlobalClock.ContinuousMilliseconds);
 }
Example #3
0
        public RobotRenderable(
            double timestamp,
            int renderPriority,
            Vector3 scale, Quaternion rotation, Vector3 position, Model model,
            Texture2D diffuseTexture, Texture2D specularTexture, Texture2D normalTexture,
            Vector3 color1, Vector3 color2
            )
            :   base(timestamp, renderPriority, scale, rotation, position, model, diffuseTexture, specularTexture, normalTexture)
        {
            this.color1 = color1;
            this.color2 = color2;

            RenderChannel         = RenderChannelType.One;
            playerArrowColorBlend = new SineFloat(0.0f, 0.5f, 2.0f);
            frozenColorBlend      = new SineFloat(0.6f, 1.0f, 2.8f);
        }
Example #4
0
        public PlayerMenu(Menu menu, LevelMenu levelMenu)
            : base(menu, new Vector2(640, 160))
        {
            this.levelMenu = levelMenu;

            playerBackgroundInactive = Game.Instance.ContentManager.Load <Texture2D>("Sprites/Menu/robot_selection_background_inactive");

            DrawPrevious = false;

            // initialize walking player hack
            Effect clonedEffect = Game.Instance.ContentManager.Load <Effect>("Effects/Basic/Basic").Clone();

            playerModel = Game.Instance.ContentManager.Load <MagmaModel>("Models/Player/robot_grp").XnaModel;
            playerMesh  = playerModel.Meshes[0];
            foreach (ModelMeshPart meshPart in playerMesh.MeshParts)
            {
                Effect oldEffect = meshPart.Effect;
                meshPart.Effect = clonedEffect;
                oldEffect.Dispose();
            }
            animator       = new ModelAnimator(playerModel);
            walkController = new AnimationController(Game.Instance, animator.Animations["walk"]);
            Game.Instance.Components.RemoveAt(Game.Instance.Components.Count - 1);
            foreach (BonePose p in animator.BonePoses)
            {
                p.CurrentController      = walkController;
                p.CurrentBlendController = null;
                p.BlendFactor            = 0.0f;
            }

            playerPreview = new RenderTarget2D[MaxPlayers];
            for (int i = 0; i < MaxPlayers; ++i)
            {
                playerPreview[i] = new RenderTarget2D(Game.Instance.GraphicsDevice, 445, 445, false,
                                                      Game.Instance.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8);
            }

            playerTexture   = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/Robot_texture10");
            specularTexture = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/robot_spec");

            playerBoxSize = new SineFloat(0.96f, 1.0f, 8.0f);
            playerBoxSize.Start(0.001f);
        }
Example #5
0
 public BasicRenderable(double timestamp, int renderPriority, Vector3 scale, Quaternion rotation, Vector3 position, Model model)
     : base(timestamp, renderPriority, scale, rotation, position, model)
 {
     start_squash        = false;
     start_blinking      = false;
     last_squash_start   = -100000;
     last_blinking_start = -100000;
     squash_wavelength   = 170;
     squash_amplitude    = 0.2f;
     BlinkingLength      = 1000;
     // FIXME: tune blinking strength here. maybe use a configuration file?
     // replace 0.55f by whatever strength is needed and 25.0f with the interval
     blinkingState         = new SineFloat(0.0f, 0.55f, 25.0f);
     UseLights             = true;
     UseMaterialParameters = true;
     UseSquash             = true;
     UseBlinking           = true;
     RenderChannel         = RenderChannelType.Three;
     if (PersistentSquash)
     {
         start_squash = true;
     }
     SetDefaultMaterialParameters();
 }
 public WinningScreenRenderable(int renderPriority, string name)
 {
     this.renderPriority = renderPriority;
     this.str            = name.ToUpper() + " HAS WON!";
     scale = new SineFloat(0.9f, 1.0f, 7.0f);
 }
Example #7
0
 private Menu()
 {
     StaticStringStrength = new SineFloat(0.7f, 1.0f, 2.5f);
     StaticStringStrength.Start(0.001);
 }