Exemple #1
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        GuiLayer.AddMoney(100);
        PlayClipSound();
        //audio.Play();
        MakeInactive();
    }
Exemple #2
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        //+1 к жизни
        GuiLayer.AddToLife(5, null);
        PlayClipSound();
        MakeInactive();
    }
Exemple #3
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        base.OnHit(other);
        GuiLayer.AddVodka(boostPrefab);
        PlayClipSound();
        //audio.Play();
        MakeInactive();
    }
Exemple #4
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        playerScript.StumbleTrigger();
        GuiLayer.AddToLife(-3, singleTransform);
        GuiLayer.AddHeadStars();
        PlayClipSound();
        MakeInactive();
    }
Exemple #5
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        base.OnHit(other);
        GlobalOptions.GetPlayerScript().boostFx.Play();
        PersonInfo.AddPost(1);
        GuiLayer.AddPostal();
        PlayClipSound();
        MakeInactive();
    }
Exemple #6
0
    private void MakeMagnit()
    {
        //этап 1
        if (effectMade == 1)
        {
            float raznx, raznz, razny, vspz;
            float smex = 0.125f;
            raznx = -parentTransform.position.x + walkingBearTransform.position.x;
            razny = -parentTransform.position.y + walkingBearTransform.position.y + 1;
            raznz = -parentTransform.position.z + walkingBearTransform.position.z;

            if (Mathf.Abs(raznx) > smex)
            {
                raznx = Mathf.Sign(raznx) * smex;
            }
            if (Mathf.Abs(razny) > smex)
            {
                razny = Mathf.Sign(razny) * smex;
            }

            if (raznz > smex)
            {
                vspz = playerScript.GetRealVelocity();
            }
            else
            {
                vspz = 0;
            }

            if (Mathf.Abs(raznz) > smex)
            {
                raznz = Mathf.Sign(raznz) * smex;
            }

            raznz += vspz;

            parentTransform.position += new Vector3(raznx, razny, raznz);
        }

        if (effectMade == 2)
        {
            float smex = 0.1f;

            camx += smex;
            camy += smex * 2.3f;

            parentTransform.position = new Vector3(cameraTransform.position.x + camx, cameraTransform.position.y + camy, walkingBearTransform.position.z + 5);

            if (parentTransform.position.y > cameraTransform.position.y + 0.5)
            {
                GuiLayer.AddMoney(numberOfMoney);
                flagRotation = false;
                effectMade   = 3;
            }
        }
    }
Exemple #7
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        GuiLayer.AddToLife(-50, singleTransform);
        GuiLayer.AddHeadStars();
        PlayClipSound();
        if (playerScript.isVodka())
        {
            playerScript.MakeVodkaBoom();
            MakeInactiveParent();
        }
    }
Exemple #8
0
        protected override void OnInitialize()
        {
            SphereModel sphere = new SphereModel(_coder, SPHERE_BREAKUPS);

            GlProgram wProgram = new GlProgram(
                new Shader(ShaderTypes.Vertex, File.ReadAllText(Path.Combine(SHADERS_DIR, WORLD_SHADERS, "vertex.glsl"))),
                new Shader(ShaderTypes.Fragment, File.ReadAllText(Path.Combine(SHADERS_DIR, WORLD_SHADERS, "fragment.glsl")))
                );

            GlProgram gProgram = new GlProgram(
                new Shader(ShaderTypes.Vertex, File.ReadAllText(Path.Combine(SHADERS_DIR, GUI_SHADERS, "vertex.glsl"))),
                new Shader(ShaderTypes.Fragment, File.ReadAllText(Path.Combine(SHADERS_DIR, GUI_SHADERS, "fragment.glsl")))
                );

            _universe.Add(new SpaceObject(2, 100000, sphere)
            {
                Position = new Vector3(0, 0, 0)
            });
            _universe.Add(new SpaceObject(8, 50, sphere)
            {
                Position = new Vector3(-500, -500, 0), Velocity = new Vector3(30f, 0, -5f)
            });
            _universe.Add(new SpaceObject(0, 250, sphere)
            {
                Position = new Vector3(500, -500, 0), Velocity = new Vector3(30f, 0, 5f)
            });
            _universe.Add(_rocket = new RocketObject(55, new RocketModel(_coder))
            {
                Position = new Vector3(500, 500, 500), Velocity = new Vector3(-30f, 0f, 0f)
            });

            RenderHandle handle = new RenderHandle(this, wProgram);

            _layer = new SceneLayer(_universe, handle);
            AddLayer(_layer);
            _cam = new OrbitalCamera(_layer.Camera)
            {
                Distance = 250
            };
            Font fnt = new Font(Path.Combine(ASSETS_DIR, FONT_DIR, FONT_FILE));

            AddLayer(new GuiFuelLayer(_rocket, this, gProgram, new GuiVertexCoder(), fnt));
            GuiLayer tutorial = new GuiLayer(this, gProgram, new GuiVertexCoder(), fnt);

            tutorial.Add(_tutorialLbl);
            AddLayer(tutorial);
            Background = new Color(50, 50, 50, 255);
            base.OnInitialize();
        }
Exemple #9
0
    public override void OnHit(Collider other)
    {
        Vector3 moveTo = Yashik.transform.position;

        if (Yashik.transform.localPosition.x > 0)
        {
            moveTo += smexToYashikRight;
        }
        else
        {
            moveTo += smexToYashikLeft;
        }
        flagMadeOnHit = true;
        GuiLayer.AddPosilka(moveTo);
        PlayClipSound();
    }
        public override void Show()
        {
            base.Show();

            var guiLayer = new GuiLayer(GraphicsDevice, Game.Camera);

            Layers.Add(guiLayer);

            var guiButtonRegion = AssetManager.Load <Texture>("play-button.png").ToTextureRegion();
            var guiButton       = new GuiButton(guiButtonRegion)
            {
                Position = new Vector2(400, 240)
            };

            guiLayer.Controls.Add(guiButton);
            _mouseCursor = guiButton;

            var font     = AssetManager.Load("courier-new-32.fnt", new BitmapFontLoader());
            var guiLabel = new GuiLabel(font)
            {
                Text = "This is a label",
                HorizontalAlignment = HorizontalAlignment.Left,
                Position            = new Vector2(100, 100),
                TextColor           = Color.Black
            };

            guiLayer.Controls.Add(guiLabel);

            var guiImageTexture = AssetManager.Load <Texture>("photo.png");
            var guiImage        = new GuiImage(guiImageTexture)
            {
                Position = new Vector2(800, 0),
                Origin   = new Vector2(1.0f, 0.0f)
            };

            guiLayer.Controls.Add(guiImage);

            var guiCheckboxTexture = AssetManager.Load <Texture>("play-button.png");
            var guiCheckbox        = new GuiCheckbox(guiCheckboxTexture.ToTextureRegion())
            {
                Position = new Vector2(500, 100),
            };

            guiLayer.Controls.Add(guiCheckbox);
        }
Exemple #11
0
    // Use this for initialization

    public override void OnHit(Collider other)
    {
        GuiLayer.AddToLife(1, singleTransform);
        PlayClipSound();
        MakeInactive();
    }
        public override void Show()
        {
            _music       = AssetManager.Load <Music>("song.mp3");
            _soundEffect = AssetManager.Load <SoundEffect>("click.wav");

            var backgroundLayer = new SpriteLayer(GraphicsDevice, Game.Camera);

            Layers.Add(backgroundLayer);

            var backgroundTexture = AssetManager.Load <Texture>("hills_800x480.png");
            var backgroundSprite  = Sprite.Create(backgroundTexture, 0, 0, 800, 480);

            backgroundLayer.Sprites.Add(backgroundSprite);

            var guiLayer = new GuiLayer(GraphicsDevice, Game.Camera);

            var font  = AssetManager.Load("courier-new-32.fnt", new BitmapFontLoader());
            var label = new GuiLabel(font)
            {
                Text      = "Welcome to",
                TextColor = new Color(81, 32, 0),
                Position  = new Vector2(400, 45)
            };

            guiLayer.Controls.Add(label);

            var logoTexture = AssetManager.Load <Texture>("astrid-logo.png");
            var image       = new GuiImage(logoTexture)
            {
                Position = new Vector2(400, -150),
                Origin   = new Vector2(0.5f, 1.0f)
            };

            guiLayer.Controls.Add(image);

            var parameters = new TransitionParameters(1.0f, EasingFunctions.QuadraticEaseIn);

            Animations.CreateSequence(image)
            .MoveTo(new Vector2(400, 150), parameters)
            .ScaleTo(new Vector2(1.2f, 0.6f), new TransitionParameters(0.2f, EasingFunctions.CubicEaseOut))
            .ScaleTo(new Vector2(1.0f, 1.0f), new TransitionParameters(0.2f, EasingFunctions.CubicEaseIn))
            .ScaleTo(new Vector2(0.8f, 1.2f), new TransitionParameters(0.2f, EasingFunctions.CubicEaseOut))
            .ScaleTo(new Vector2(1.0f, 1.0f), new TransitionParameters(0.2f, EasingFunctions.CubicEaseIn))
            .Play();

            var buttonTexture = AssetManager.Load <Texture>("play-button.png");
            var playButton    = new GuiButton(buttonTexture.ToTextureRegion())
            {
                Position = new Vector2(400, -260),
                Rotation = MathHelper.TwoPi
            };

            playButton.Click += PlayButtonOnClick;
            guiLayer.Controls.Add(playButton);
            Layers.Add(guiLayer);

            var transitionParameters = new TransitionParameters(1.0f, EasingFunctions.CubicEaseInOut);

            Animations
            .CreateSequence(playButton)
            .MoveTo(new Vector2(50, 50), transitionParameters)
            .MoveTo(new Vector2(700, 400), transitionParameters)
            .MoveTo(new Vector2(700, 230), transitionParameters)
            .MoveTo(new Vector2(400, 250), transitionParameters)
            .Delay(1.0f)
            .RotateTo(0, transitionParameters)
            .Delay(1.0f)
            .RotateTo(MathHelper.TwoPi, transitionParameters)
            .FadeOut(transitionParameters)
            .FadeIn(transitionParameters)
            .Play();

            base.Show();
        }