Example #1
0
        public GameManager(float width, float height)
        {
            float backgroundWidth  = width;
            float backgroundHeight = height;
            float backgroundScale  = backgroundWidth / 100f;

            Background = new GameBackground(0, 0, 100f, backgroundHeight / backgroundScale, backgroundScale);

            float topBarWidth  = backgroundWidth;
            float topBarHeight = backgroundWidth * 0.12f;
            float topBarScale  = topBarWidth / 100f;

            TopBar = new GameTopBar(0, 0, 100f, topBarHeight / topBarScale, topBarScale);

            float gameWidth  = backgroundWidth;
            float gameHeight = (backgroundWidth * 4) / 3;
            float gameScale  = gameWidth / 100f;

            State = new GameState(0, topBarHeight, 100f, gameHeight / gameScale, gameScale);

            float menuWidth  = backgroundWidth;
            float menuHeight = backgroundHeight - topBarHeight - gameHeight;
            float menuScale  = menuWidth / 100f;

            Menu = new GameMenu(0, topBarHeight + gameHeight, 100f, menuHeight / menuScale, menuScale);

            Overlay = new GameOverlay(0, 0, 100f, backgroundHeight / backgroundScale, backgroundScale);
        }
        protected override void OnAddToStageComplete()
        {
            base.OnAddToStageComplete();

            gameOverlay = SmuckGame.GameOverlay;
            gameOverlay.Activate();
            isLevelOver   = false;
            summaryPosted = false;
            winningPlayer = -1;
            SetGoals(9, 4);

            LaneInit();
            LevelInit();
            gameOverlay.SetLevel(LevelKind, levelNumber);

            if (defaultShader != null)
            {
                ((DesaturationShader)defaultShader).level = 1f;
            }

            for (int i = 0; i < screen.inputManagers.Length; i++)
            {
                if (screen.inputManagers[i] != null && screen.inputManagers[i].PlayerJoinState == PlayerJoinState.Joined)
                {
                    CreatePlayer(i);
                }
            }

            firstUpdate = true;
        }
 private PwnieHax(LocalProcess process) : base(process, process.CreateMemoryInterface(WinAPI.ProcessAccessFlags.All, true))
 {
     //Initialize & set up low-level keyboard hook
     keyboard = new KeyboardHook();
     keyboard.Hook();
     keyboard.KeyUp   += (o, e) => { OnKeyUp(e.Key); };
     keyboard.KeyDown += (o, e) => { OnKeyDown(e.Key); };
     mouse             = new MouseHook();
     mouse.Hook();
     mouse.MouseEvent += Mouse_MouseEvent;
     //Initialize & set up overlay
     Overlay          = new GameOverlay(this, "PwnieHax");
     Overlay.Drawing += Overlay_Drawing;
     Overlay.DrawOnlyWhenInForeground = false;
     Overlay.RegisterHooks(keyboard, mouse);
     MainForm = Overlay;
     //
     performanceLabel = new SuperiorHackBase.Graphics.Controls.Label()
     {
         Text      = "- FPS\n- read\n- write",
         AutoSize  = true,
         BackColor = BrushDescription.Transparent,
         ForeColor = BrushDescription.White,
         Location  = new Vector2(4, 4),
         Font      = new FontDescription("Courier New", 12f)
     };
     Overlay.RootControl.AddChild(performanceLabel);
     fps = new RoundRobinBuffer(60);
 }
Example #4
0
    private void Start()
    {
        _gameOverlay = GetComponent <GameOverlay>();

        _holdingWith = transform
                       .GetComponentsInChildren <Transform>()
                       .First(trans => trans.name == "CameraHolder");
    }
Example #5
0
    protected override void Start()
    {
        base.Start();

        _holdingState      = GetComponent <PlayerHoldingState>();
        _animationSwitcher = GetComponent <AnimationSwitcher>();
        _gameOverlay       = GetComponent <GameOverlay>();
    }
Example #6
0
    protected override void Start()
    {
        base.Start();

        _holdingState      = this.GetComponent <PlayerHoldingState>();
        _animationSwitcher = GetComponent <AnimationSwitcher>();
        _audioController   = GetComponent <AudioController>();
        _playerOverlay     = this.GetComponent <GameOverlay>();
    }
Example #7
0
    protected override void Start()
    {
        base.Start();

        timeLeft = movementTimeLimit;   // Set the time that the user has to move to the movementTimeLimit

        _holdingState      = GetComponent <PlayerHoldingState>();
        _frozenState       = GetComponent <PlayerFrozenState>();
        _animationSwitcher = GetComponent <AnimationSwitcher>();
        _audioController   = GetComponent <AudioController>();
        _gameOverlay       = GetComponent <GameOverlay>();

        _holdingState.MaxRunWithBallTime = movementTimeLimit;
    }
Example #8
0
 public void CheckOverlay()
 {
     if (overlayWindow == null && Config.GetInstance().Settings_EnableOverlay)
     {
         // turn on
         overlayWindow = new GameOverlay();
         overlayWindow.Show();
     }
     else if (overlayWindow != null && !Config.GetInstance().Settings_EnableOverlay)
     {
         // turn off
         overlayWindow.Close();
         overlayWindow = null;
     }
 }
Example #9
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     Process[] p = Process.GetProcessesByName("csgo");
     if (p.Length != 0)
     {
         bufferByte.Initialize("csgo");
         Globals.Client = bufferByte.GetModuleAddress("client.dll");
         Globals.Engine = bufferByte.GetModuleAddress("engine.dll");
         GameOverlay.InıtOverlay();
     }
     else
     {
         MessageBox.Show("Please, open CSGO", "CSGOESP", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Environment.Exit(0);
     }
 }
        public override void Removed(EventArgs e)
        {
            base.RemovedFromStage(e);

            foreach (SmuckPlayer p in players)
            {
                if (p != null)
                {
                    this.RemoveChild(p);
                    p.body = null;
                }
            }
            for (int i = 0; i < lanes.Length; i++)
            {
                for (int j = 0; i < lanes[i].vehicles.Count; j++)
                {
                    if (lanes[i].vehicles[j] != null && this.Contains(lanes[i].vehicles[j]))
                    {
                        RemoveChild(lanes[i].vehicles[j]);
                    }
                    lanes[i].vehicles[j] = null;
                    lanes[i].vehicles.Clear();
                }
                lanes[i] = null;
            }
            lanes   = null;
            vehicle = null;

            for (int i = 0; i < deadIcons.Count; i++)
            {
                RemoveChild(deadIcons[i]);
            }
            deadIcons.Clear();

            if (starParticles != null)
            {
                RemoveChild(starParticles);
            }

            gameOverlay = null;
        }
Example #11
0
 public void DisableOverlay()
 {
     GameOverlay.Hide();
 }
Example #12
0
 public void EnableOverlay()
 {
     GameOverlay.Show();
 }
Example #13
0
    /*** Script Methods ***/
    // Use this for initialization
    void Start()
    {
        /*** Init. Game System ***/

        // Default camera zoom
        Camera.main.orthographicSize = Globals.MinCameraSize + (Globals.MaxCameraSize - Globals.MinCameraSize) / 2.0f;

        // Instantiate all game-level objects
        SManager = gameObject.AddComponent(typeof(SpriteManager)) as SpriteManager;
        ProjManager = gameObject.AddComponent(typeof(ProjectileManager)) as ProjectileManager;
        ShipManager = gameObject.AddComponent(typeof(ShipsManager)) as ShipsManager;
        SceneManager = gameObject.AddComponent(typeof(SceneryManager)) as SceneryManager;
        ResManager = gameObject.AddComponent(typeof(ResourceManager)) as ResourceManager;
        BuildingManager = gameObject.AddComponent(typeof(BuildingManager)) as BuildingManager;
        AManager = gameObject.AddComponent(typeof(AudioManager)) as AudioManager;
        SongManager = gameObject.AddComponent(typeof(AudioSystem)) as AudioSystem;
        OverlayView = gameObject.AddComponent(typeof(GameOverlay)) as GameOverlay;
        ContextMenuView = gameObject.AddComponent(typeof(GameContextMenu)) as GameContextMenu;

        /*** Background System ***/

        // Allocate the background sprites
        BackgroundSprites = new Sprite[BackgroundLayerCount];
        for(int i = 0; i < BackgroundLayerCount; i++)
        {
            // Alloc and retain
            Sprite Background = new Sprite("Textures/BGLayer" + i);
            BackgroundSprites[i] = Background;

            // Make the sprite geometry as big as the max camera, and center it on the camera
            BackgroundSprites[i].SetGeometrySize(new Vector2(Globals.MaxCameraSize, Globals.MaxCameraSize) * 2.5f * Camera.main.aspect);
            BackgroundSprites[i].SetPosition(-BackgroundSprites[i].GetGeometrySize() / 2.0f);
            BackgroundSprites[i].SetDepth(Globals.BackgroundDepth - i); // Each layet is closer to the camera

            // Register sprite
            SManager.AddSprite(Background);
        }

        /*** Add Scene Elements & Load Enemey Spawn List ***/

        // Load the level gen. (note that we finish loading in the "OnLevelWasLoaded" because
        // of a Unity3D-specific design issue
        LevelLoaded = false;
        LevelGen = new LevelManager(TargetLevel);

        /*** TESTING: Add temp ships ***/

        // Create a few ships destroyers bottom right
        for(int i = 0; i < 6; i++)
        {
            int x = UnityEngine.Random.Range(-500, 500);
            int y = UnityEngine.Random.Range(-500, 500);

            BaseShip Friendly = null;
            if(i == 0)
                Friendly = new CarrierShip();
            else if(i == 1)
                Friendly = new DestroyerShip();
            else
                Friendly = new FighterShip();
            Friendly.SetPos(new Vector2(x, y));
            ShipManager.ShipsList.Add(Friendly);
        }
    }
Example #14
0
 //Lives UI
 private void SetUpLives()
 {
     gameOverlay = FindObjectOfType <GameOverlay>();
 }
Example #15
0
 private void InitGameOverlay()
 {
     _gameOverlay = FindObjectOfType <GameOverlay>();
     _gameOverlay?.Init();
 }