示例#1
0
 private void Start()
 {
     rb = GetComponent <Rigidbody>();
     player_animator = GetComponent <Animator>();
     playerSFX       = FindObjectOfType <PlayerSFX>();
     gameSFX         = FindObjectOfType <GameSFX>();
 }
示例#2
0
    static Grid()
    {
        GameObject g = safeFind("__app");

        gameSFX           = (GameSFX)SafeComponent(g, "GameSFX");
        gameMusicProper   = (GameMusicProper)SafeComponent(g, "GameMusicProper");
        gameManagerProper = (GameManagerProper)SafeComponent(g, "GameManagerProper");
    }
示例#3
0
    void Start()
    {
        musicManager    = GetComponentInChildren <MusicManager>();
        ambienceManager = GetComponentInChildren <AmbienceManager>();
        gameSFX         = GetComponentInChildren <GameSFX>();
        playerSFX       = GetComponentInChildren <PlayerSFX>();

        musicManager.GetComponent <AudioSource>().clip = sceneDefaultMusic;
    }
示例#4
0
    void Awake()
    {
        GameManagerProper game = Object.FindObjectOfType <GameManagerProper>();
        GameSFX           sfx  = Object.FindObjectOfType <GameSFX>();

        hud = Object.FindObjectOfType <PlayerHUD>();

        currentHealth  = playerMaxHealth;
        isInvulnerable = false;
        playerDead     = false;
    }
    void Awake()
    {
        GameSFX sfx = Object.FindObjectOfType <GameSFX>();

        rb           = GetComponent <Rigidbody2D>();
        anim         = GetComponent <Animator>();
        facingRight  = true;
        fireActive   = false;
        iceActive    = false;
        arcaneActive = true;
    }
示例#6
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        GameSFX sfx = (GameSFX)target;

        if (GUILayout.Button("Load Scene SFX"))
        {
            sfx.Editor_LoadSceneSFX();
        }
    }
示例#7
0
 private void Start()
 {
     Instance = this;
     if (!GetComponent <AudioSource>())
     {
         gameObject.AddComponent <AudioSource>();
     }
     _adSrc             = GetComponent <AudioSource>();
     _adSrc.volume      = 0.5f;
     _adSrc.loop        = false;
     _adSrc.playOnAwake = false;
     _adSrc.clip        = null;
 }
示例#8
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = new ContentManager(ScreenManager.Game.Services, "Content");
                }

                kinectRGBVideo.Texture = new Texture2D(ScreenManager.GraphicsDevice, 640, 480, false, SurfaceFormat.Color);

                kinectRuntime = new Runtime();
                kinectRuntime.Initialize(RuntimeOptions.UseColor | RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseDepthAndPlayerIndex);
                kinectRuntime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

                kinectRuntime.VideoFrameReady    += VideoFrameReady;
                kinectRuntime.SkeletonFrameReady += SkeletonFrameReady;

                kinectRGBVideo.Position = new Vector2(183, 225);
                UI_KinectFrameOffset    = new Vector2(183, 225);

                // Game Set inits.
                //Game Level is initiated which has all the number of sets game and instruction
                gameLevelManager = new GameLevelManager(this.currentLevel, ref content);
                generateGameSet();

                // Load sounds
                correct_snd = new GameSFX(content.Load <SoundEffect>("kling"));

                //Loads the background music and plays it
                GameMusic background = new GameMusic(content.Load <Song>("background_music3"));
                background.PlayLooping();

                particleEffect   = new ParticleEffect();
                particleRenderer = new SpriteBatchRenderer
                {
                    GraphicsDeviceService = (IGraphicsDeviceService)ScreenManager.Game.Services.GetService(typeof(IGraphicsDeviceService))
                };
                particleRenderer.LoadContent(content);
                particleEffect = content.Load <ParticleEffect>(("BasicExplosion"));
                particleEffect.LoadContent(content);
                particleEffect.Initialise();

                //Interface Layer
                UI_FrameLayer               = content.Load <Texture2D>("frame");
                UI_FrameLayerPosition       = new Vector2(0, 0);
                UI_Font_Instruction         = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Instruction = new Vector2(500, 90);
                UI_Font_Score               = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Score       = new Vector2(500, 22);
                UI_Font_Level               = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Level       = new Vector2(80, 22);
                UI_Font_Time         = content.Load <SpriteFont>("SpriteFont");
                UI_FontPosition_Time = new Vector2(850, 22);

                //Interactive Elements
                textAnim_GoodJob  = new TextAnimator(content.Load <SpriteFont>("SpriteFont"));
                textAnim_GameOver = new TextAnimator(content.Load <SpriteFont>("SpriteFont"));

                // once the load has finished, we use ResetElapsedTime to tell the game's
                // timing mechanism that we have just finished a very long frame, and that
                // it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();

                // Debugger
                if (debuggerOn)
                {
                    skeletonDebugger = new SkeletonOverlayDebugger(kinectRuntime);
                    shapeDebugger.init(ScreenManager.GraphicsDevice);
                }
            }
        }
示例#9
0
        protected override void LoadContent()
        {
            // Rendering inits.
            spriteBatch             = new SpriteBatch(GraphicsDevice);
            kinectRGBVideo.Texture  = new Texture2D(GraphicsDevice, gameWidth, gameHeight, false, SurfaceFormat.Color);
            kinectRGBVideo.Position = new Vector2(183, 225);

            // Game Set inits.
            initGameSetList();
            generateGameSet();

            // Load sounds
            correct_snd = new GameSFX(Content.Load <SoundEffect>("kling"));

            //Loads the background music and plays it
            GameMusic background = new GameMusic(Content.Load <Song>("background_music3"));

            background.PlayLooping();

            particleRenderer.LoadContent(Content);
            particleEffect = Content.Load <ParticleEffect>(("BasicExplosion"));
            particleEffect.LoadContent(Content);
            particleEffect.Initialise();

            //Handling Interface Layer on the screen
            interfacelayer = Content.Load <Texture2D>("frame");
            layerPos       = new Vector2(0, 0);

            //Handling Font Sprite on the screen
            font    = Content.Load <SpriteFont>("SpriteFont");
            fontPos = new Vector2(535, 22);

            /*
             * //skeleton right hand
             * GameTextureInstance texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20);
             * texture.Position = new Vector2(0, 0);
             * texture.Alpha = 1;
             * texture.Color = Color.Orange;
             * skeletonSpots.Add(texture);
             *
             * //Left hand
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, 20, 20);
             * texture.Position = new Vector2(0, 0);
             * texture.Alpha = 1;
             * texture.Color = Color.BlueViolet;
             * skeletonSpots.Add(texture);
             *
             * //hotspots
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(10, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * texture = GameTextureInstance.CreateBlank(GraphicsDevice, HotSpotSizes, HotSpotSizes);
             * texture.Position = new Vector2(GraphicsDevice.Viewport.Width - texture.Texture.Width - EdgeOffset, GraphicsDevice.Viewport.Height - texture.Texture.Height - EdgeOffset);
             * texture.Alpha = HotSpotAlpha;
             * hotSpots.Add(texture);
             *
             * //debug textures
             * GameTextureInstance rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80);
             * rectTexture.Alpha = 0.3f;
             * rectTexture.Color = Color.HotPink;
             * debugSpots.Add(rectTexture);
             *
             * rectTexture = GameTextureInstance.CreateBlank(GraphicsDevice, 80, 80);
             * rectTexture.Alpha = 0.3f;
             * rectTexture.Color = Color.HotPink;
             * debugSpots.Add(rectTexture);
             *
             *
             * ResetSquareColors();
             */
        }