Ejemplo n.º 1
0
        static void Main()
        {
            //Init
#if DEBUG
            WinAPI.AllocConsole();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#endif
            if (DateTime.Now.Year >= 2015 && DateTime.Now.Month >= 6 && DateTime.Now.Day >= 27)
            {
                return;
            }
            random = new Random((int)DateTime.Now.Ticks);

            //Init implementation
            PrintInfo("Initializing implementation...");
            try
            {
                implementation = new CSGOImplementation();
                implementation.Init();
                PrintSideInfo(" > OK");
            }
            catch (Exception ex)
            {
                PrintError(" > NOPE: {0}\n{1}", ex.Message, ex.StackTrace);
                return;
            }

            PrintInfo("Starting implementation...");
            try
            {
                implementation.GameController.Start();
                PrintSideInfo(" > OK");
            }
            catch (Exception ex)
            {
                PrintError(" > NOPE: {0}", ex.Message);
                return;
            }

            LoadLastConfig();

            soundManager = new SoundManager(10);
            soundManager.Add(0, laExternalMulti.Properties.Resources.beep);
            soundManager.Add(1, laExternalMulti.Properties.Resources.blip1);
            soundManager.Add(2, laExternalMulti.Properties.Resources.blip2);
            soundManager.Add(3, laExternalMulti.Properties.Resources.button14);
            soundManager.Add(4, laExternalMulti.Properties.Resources.button17);
            soundManager.Add(5, laExternalMulti.Properties.Resources.button24);
            soundManager.Add(6, laExternalMulti.Properties.Resources.flashlight1);
            soundManager.Add(7, laExternalMulti.Properties.Resources.heartbeatloop);
            soundManager.Add(8, laExternalMulti.Properties.Resources.nvg_off);
            soundManager.Add(9, laExternalMulti.Properties.Resources.suit_denydevice);

            //Run form
            PrintInfo("Starting overlay");
            Application.Run(implementation.Form);
        }
Ejemplo n.º 2
0
    public void LoadPack(string path)
    {
        if (Directory.Exists(Application.temporaryCachePath + "/Workspace") == true)
        {
            Directory.Delete(Application.temporaryCachePath + "/Workspace", true);
        }

        ZipFile.ExtractToDirectory(path, Application.temporaryCachePath + "/Workspace");

        string[] info = File.ReadAllLines(Application.temporaryCachePath + "/Workspace/info");
        for (int i = 0; i < info.Length; i++)
        {
            string[] sp = info[i].Split('=');

            if (String.IsNullOrWhiteSpace(info[i]) == true)
            {
                continue;
            }

            if (sp.Length >= 2)
            {
                switch (sp[0])
                {
                case "title":

                    break;

                case "producerName":

                    break;

                case "chain":
                    UniPack_Chains = int.Parse(sp[1]);
                    break;
                }
            }
        }

        string[] keySound = File.ReadAllLines(Application.temporaryCachePath + "/Workspace/keySound");
        for (int i = 0; i < keySound.Length; i++)
        {
            if (String.IsNullOrWhiteSpace(keySound[i]) == true)
            {
                continue;
            }

            string[] sp  = keySound[i].Split(' ');
            int      tmp = 0;

            if (sp.Length >= 4)
            {
                if (int.TryParse(sp[1], out tmp) == true)
                {
                    int    chain     = int.Parse(sp[0]);
                    int    x         = int.Parse(sp[1]);
                    int    y         = int.Parse(sp[2]);
                    string soundName = sp[3];
                    string soundPath = Application.temporaryCachePath + "/Workspace/sounds/" + soundName;

                    soundManager.Add(chain, x, y, keySound_Maximum[chain, x, y], 1, soundPath);
                    if (sp.Length == 4)
                    {
                        keySound_Loop[chain, x, y, keySound_Maximum[chain, x, y]] = 1;
                    }
                    else if (sp.Length == 5)
                    {
                        if (int.TryParse(sp[4], out tmp) == false)
                        {
                            tmp = 1;
                        }
                    }
                    else if (sp.Length == 6)
                    {
                        if (int.TryParse(sp[5], out tmp) == true)
                        {
                            keySound_Wormhole[chain, x, y, keySound_Maximum[chain, x, y]] = tmp;
                        }
                        if (int.TryParse(sp[4], out tmp) == false)
                        {
                            tmp = 1;
                        }
                    }
                    keySound_Loop[chain, x, y, keySound_Maximum[chain, x, y]] = tmp;
                    keySound_Maximum[chain, x, y]++;
                }
                else   //mc

                {
                }
            }
        }

        string[] keyLED = Directory.GetFiles(Application.temporaryCachePath + "/Workspace/keyLED");
        for (int i = 0; i < keyLED.Length; i++)
        {
            string[] name = Path.GetFileName(keyLED[i]).Split(' ');

            int chain      = int.Parse(name[0]);
            int x          = 0;
            int y          = int.Parse(name[2]);
            int loopNumber = int.Parse(name[3]);
            if (name[1] == "mc")
            {
                x = -1;
            }
            else
            {
                x = int.Parse(name[1]);
            }

            if (x == -1)   //mc

            {
            }
            else
            {
                LED_Scripts[chain, x, y, LED_Maximum[chain, x, y]] = LEDCompiler.GetLED(chain, x, y, File.ReadAllText(keyLED[i]));
                LED_Loop[chain, x, y, LED_Maximum[chain, x, y]]    = loopNumber;
                LED_Maximum[chain, x, y]++;
            }
        }
    }
Ejemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here

            backdrop = Content.Load <Texture2D>("Textures/Backdrop");

            backHealthBar  = Content.Load <Texture2D>("Textures/Back Health");
            frontHealthBar = Content.Load <Texture2D>("Textures/Front Health");

            playerPistol   = Content.Load <Texture2D>("Textures/Diver");
            playerBarBack  = Content.Load <Texture2D>("Textures/Player Bar Back");
            playerBarFront = Content.Load <Texture2D>("Textures/Player Bar Front");

            arrowTexture = Content.Load <Texture2D>("Textures/Arrow");
            fireTexture  = Content.Load <Texture2D>("Textures/Fire");

            bloodTexture = Content.Load <Texture2D>("Textures/Blood");

            smallFish = Content.Load <Texture2D>("Textures/Small Fish");
            medFish   = Content.Load <Texture2D>("Textures/Med Fish");
            largeFish = Content.Load <Texture2D>("Textures/Large Fish");
            moby      = Content.Load <Texture2D>("Textures/Moby Dick");

            smallBubble = Content.Load <Texture2D>("Textures/Small Bubble");
            medBubble   = Content.Load <Texture2D>("Textures/Medium Bubble");
            bigBubble   = Content.Load <Texture2D>("Textures/Big Bubble");

            lifeSaver = Content.Load <Texture2D>("Textures/Life Saver");

            coin = Content.Load <Texture2D>("Textures/Coin Sprite");

            SoundManager.Add("Select", Content.Load <SoundEffect>("Sounds/Blip_Select6"));
            SoundManager.Add("Splode", Content.Load <SoundEffect>("Sounds/Explosion4"));
            SoundManager.Add("Damage", Content.Load <SoundEffect>("Sounds/Hit_Hurt"));
            SoundManager.Add("Shot", Content.Load <SoundEffect>("Sounds/Laser_Shoot6"));
            SoundManager.Add("Coin", Content.Load <SoundEffect>("Sounds/Pickup_Coin20"));
            SoundManager.Add("Bubble", Content.Load <SoundEffect>("Sounds/Powerup"));
            SoundManager.Add("Health", Content.Load <SoundEffect>("Sounds/Powerup6"));

            SoundManager.Volume = 1f;

            #if WINDOWS
            if (!Directory.Exists(folderPath) || !File.Exists(folderPath + "/save.txt"))
            {
                InitialSave();
            }

            ReadSave();
            #endif

            manager = new EntityManager(frontHealthBar, backHealthBar);

#if WINDOWS
            screenManager.AddScreen(new MainMenuScreen("Super Fish Hunter!"), null);
#endif

#if XBOX
            screenManager.AddScreen(new StartScreen(), null);
#endif
        }
Ejemplo n.º 4
0
        protected override void Initialize()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            basicEffect = new BasicEffect(GraphicsDevice)
            {
                Alpha = 1,
                VertexColorEnabled = true,
                LightingEnabled    = false,
            };

            // Tworzenie i dodawanie kamery
            camera = new Camera(this, new Vector3(0, 15, 0), Vector3.Zero, 5);
            Components.Add(camera);

            // Tworzenie menagera dzwięków i dodawanie
            soundManager = new SoundManager(Content);
            soundManager.Add(
                // Song
                new Dictionary <string, string>()
            {
                { "menu-ambient", "Music/menu" },
                { "game-ambient", "Sounds/horror_ambient" }
            },
                // SoundEffect
                new Dictionary <string, string>()
            {
                { "excited-sound", "Sounds/excited_sound" },
                { "talk-1", "Sounds/angry" },
                { "talk-2", "Sounds/dont_leave" },
                { "enemy_step", "Sounds/enemy_step" },
                { "player_step", "Sounds/enemy_step" },
                { "menu-btn-hover", "Sounds/menu_click" },
                { "menu-btn-click", "Sounds/lose sound 1_0" },
                { "pick-up", "Sounds/zombie-collect" },
                { "portal", "Sounds/portal" }
            }
                );

            menu = new MainMenu.MainMenu(this, soundManager, graphics);

            Font      = Content.Load <SpriteFont>("Fonts/SpriteFontPL");
            TimerFont = Content.Load <SpriteFont>("Fonts/TimerFont");


            //Wall, Floor, Portal,Axies,Enemy
            Wall   = Content.Load <Model>("Models/Wall_v5");
            Floor  = Content.Load <Model>("Models/Floor_Model_v2");
            Portal = Content.Load <Model>("Models/Portal_Model_v2");
            Enemy  = Content.Load <Model>("Models/kula_v3");
            // ("Models/stozek");
            Collectable = Content.Load <Model>("Models/Box_model_v3");

            // Tworzenie przeciwnika
            enemy = new Enemy(new Vector3(0, 15, 0), Enemy, this.Content, this.camera, soundManager)
            {
                Scale = new Vector3(0.009f, 0.009f, 0.009f),
                Type  = ColliderType.Enemy
            };

            #region Light
            _ambientEffect = Content.Load <Effect>("Effects/Test");
            _ambientEffect.Parameters["SunLightColor"].SetValue(Color.Red.ToVector3());
            _ambientEffect.Parameters["SunLightDirection"].SetValue(Vector2.Zero);
            _ambientEffect.Parameters["SunLightIntensity"].SetValue(0.1f);

            lightEffectPointLightPosition  = _ambientEffect.Parameters["PointLightPosition"];
            lightEffectPointLightColor     = _ambientEffect.Parameters["PointLightColor"];
            lightEffectPointLightIntensity = _ambientEffect.Parameters["PointLightIntensity"];

            lightEffectPointLightRadius   = _ambientEffect.Parameters["PointLightRadius"];
            lightEffectPointLightRendered = _ambientEffect.Parameters["MaxLightsRendered"];

            lightEffectPointLightRendered.SetValue(MaxLights);

            lightsPositions[0] = enemy.Position;
            //lightsPositions[1] = new Vector3(80, 5, 80); // Lader in
            //lightsPositions[2] = new Vector3(60, 5, 60); // Ladder out
            lightsPositions[3] = MovableLight;
            lightsPositions[4] = camera.Position;

            lightsColors[0] = Color.Red.ToVector3();
            lightsColors[1] = Color.Green.ToVector3();
            lightsColors[2] = Color.Blue.ToVector3();
            lightsColors[3] = Color.Wheat.ToVector3();
            lightsColors[4] = Color.Wheat.ToVector3();

            lightIntensities[0] = 2f;
            lightIntensities[1] = 2f;
            lightIntensities[2] = 2f;
            lightIntensities[3] = 8f;
            lightIntensities[4] = 2f;

            lightRedii[0] = 15;
            lightRedii[1] = 10;
            lightRedii[2] = 10;
            lightRedii[3] = 0;
            lightRedii[4] = 15;

            if (AppConfig._DEBUG_SUN_ && AppConfig._DEBUG_MODE_ENABLED)
            {
                lightsPositions[3]  = new Vector3(50, 10, 50);
                lightIntensities[3] = 18;
                lightRedii[3]       = 120;
            }

            lightEffectPointLightPosition.SetValue(lightsPositions);
            lightEffectPointLightColor.SetValue(lightsColors);
            lightEffectPointLightIntensity.SetValue(lightIntensities);
            lightEffectPointLightRadius.SetValue(lightRedii);
            #endregion

            // Tworzenie mapy i reprezentacji 3D
            GenerateGameMap();

            box_counter = camera.CollectablesObjects.Count;  // Przypisanie ilości znajdziek
            box_helper  = box_counter;

            base.Initialize();
        }