Inheritance: MonoBehaviour
Beispiel #1
0
        public bool Equals(ParticleObject other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Position.Equals(other.Position) &&
                   NextParticleObjectPointer.Equals(other.NextParticleObjectPointer) &&
                   PrevParticleObjectPointer.Equals(other.PrevParticleObjectPointer) &&
                   ParticlePointer.Equals(other.ParticlePointer) &&
                   Timer.Equals(other.Timer) &&
                   Type.Equals(other.Type) &&
                   ParticleType.Equals(other.ParticleType) &&
                   NumEffectCycles.Equals(other.NumEffectCycles) &&
                   SkipFrames.Equals(other.SkipFrames) &&
                   FrameCounter.Equals(other.FrameCounter) &&
                   State.Equals(other.State) &&
                   Target.Equals(other.Target) &&
                   Spread.Equals(other.Spread) &&
                   Size.Equals(other.Size) &&
                   Color.Equals(other.Color) &&
                   DestroyWhenFar.Equals(other.DestroyWhenFar) &&
                   CreationChance.Equals(other.CreationChance) &&
                   Unknown.Equals(other.Unknown));
        }
Beispiel #2
0
 public ColorService(ControlService controlService)
 {
     controlService.ColorService = this;
     _watch                             = new Stopwatch();
     _streamTokenSource                 = new CancellationTokenSource();
     _targetTokenSource                 = new CancellationTokenSource();
     _sDevices                          = Array.Empty <IColorTarget>();
     _systemData                        = DataUtil.GetSystemData();
     LedColors                          = new Color[_systemData.LedCount];
     SectorColors                       = new Color[+_systemData.SectorCount];
     _enableAutoDisable                 = _systemData.EnableAutoDisable;
     _streams                           = new Dictionary <string, ColorSource>();
     ControlService                     = controlService;
     Counter                            = new FrameCounter(this);
     ControlService.SetModeEvent       += Mode;
     ControlService.DeviceReloadEvent  += RefreshDeviceData;
     ControlService.RefreshLedEvent    += ReloadLedData;
     ControlService.RefreshSystemEvent += ReloadSystemData;
     ControlService.TestLedEvent       += LedTest;
     ControlService.FlashDeviceEvent   += FlashDevice;
     ControlService.FlashSectorEvent   += FlashSector;
     ControlService.DemoLedEvent       += Demo;
     _splitter                          = new FrameSplitter(this);
     LoadServices();
 }
Beispiel #3
0
        public override void UnloadContent()
        {
            camera         = null;
            frameCounter   = null;
            font           = null;
            tilemapTexture = null;
            level          = null;
            pixel          = null;
            backgroundWaterGradientStrip = null;
            energyBar           = null;
            player              = null;
            spikesPointingDown  = null;
            spikesPointingUp    = null;
            spikesPointingLeft  = null;
            spikesPointingRight = null;
            enemies             = null;
            SFX = null;

            //MediaPlayer.Stop();
            //song.Dispose();
            //song = null;

            //Console.WriteLine(song);
            //Console.WriteLine("HHERERERasdasd");

            base.UnloadContent();
        }
 public MurasaChargeSkillState(Murasa parent)
     : base(parent)
 {
     framecounter = new FrameCounter(10);
     CreateBullet();
     parameter.stamina.quantity -= 10;
 }
Beispiel #5
0
        /// <summary>
        /// Initialize any components required by this state.
        /// </summary>
        public override void Initialize()
        {
            ServiceManager.Game.FormManager.ClearWindow();
            Options options = ServiceManager.Game.Options;

            RendererAssetPool.DrawShadows = GraphicOptions.ShadowMaps;
            mouseCursor = new MouseCursor(options.KeySettings.Pointer);
            mouseCursor.EnableCustomCursor();
            renderer    = ServiceManager.Game.Renderer;
            fps         = new FrameCounter();
            Chat        = new ChatArea();
            Projectiles = new ProjectileManager();
            Tiles       = new TexturedTileGroupManager();
            Utilities   = new UtilityManager();
            cd          = new Countdown();
            Lazers      = new LazerBeamManager(this);
            Scene.Add(Lazers, 0);
            Players            = new PlayerManager();
            currentGameMode    = ServiceManager.Theater.GetCurrentGameMode();
            Flags              = new FlagManager();
            Bases              = new BaseManager();
            EnvironmentEffects = new EnvironmentEffectManager();
            buffbar            = new BuffBar();
            Scores             = new ScoreBoard(currentGameMode, Players);
            input              = new ChatInput(new Vector2(5, ServiceManager.Game.GraphicsDevice.Viewport.Height), 300);//300 is a magic number...Create a chat width variable.
            input.Visible      = false;
            hud              = HUD.GetHudForPlayer(Players.GetLocalPlayer());
            localPlayer      = Players.GetLocalPlayer();
            Scene.MainEntity = localPlayer;
            sky              = ServiceManager.Resources.GetTexture2D("textures\\misc\\background\\sky");
            tips             = new GameTips(new GameContext(CurrentGameMode, localPlayer));
            helpOverlay      = new HelpOverlay();
        }
 public ReimuChargeSkillState(Character parent)
     : base(parent)
 {
     framecounter = new FrameCounter(10);
     CreateBullet();
     parameter.stamina.quantity -= 10;
 }
Beispiel #7
0
 public PanelInfo()
 {
     Position = Vector2.Zero;
     frameCounter = new FrameCounter();
     fps = "0";
     gameTime = eGameTime = string.Empty;
 }
 public YugiSkillState(Character parent)
     : base(parent)
 {
     framecounter = new FrameCounter(10);
     CreateBullet();
     parameter.stamina.quantity -= 10;
 }
 public MurasaChargeSkillState(Murasa parent)
     : base(parent)
 {
     framecounter = new FrameCounter(10);
     CreateBullet();
     parameter.stamina.quantity -= 10;
 }
Beispiel #10
0
        protected void SetIconAnimation()
        {
            if (myActiveAnimation != EIconActiveAnimation.None)
            {
                // do active animation stuff
            }
            else
            {
                switch (myPassiveAnimation)
                {
                case EIconPassiveAnimation.Squeeze:
                    myIcon.SetScale(new Vector2(1.1f, 0.8f));
                    myIcon.SetPosition(myIcon.GetPosition() + new Vector2(-GetTileSize() * 0.05f, GetTileSize() * 0.2f));
                    break;

                case EIconPassiveAnimation.Jump:
                    const float FramesBetweenJumps = 10.0f;
                    float       wrappedFrames      = FrameCounter.GetCurrentFrame() / FramesBetweenJumps;
                    float       jumpProgress       = (float)Math.Abs(Math.Sin(wrappedFrames));
                    const float JumpHeightPercent  = 0.05f;

                    //float extraXScale = (1f - jumpProgress) * 0.1f;
                    //myIcon.SetScale(new Vector2(1f + extraXScale, 1f));
                    myIcon.SetPosition(myIcon.GetPosition() + new Vector2(0.0f, -JumpHeightPercent * GetTileSize() * jumpProgress));    // + new Vector2(-extraXScale / 2f, 0.0f));
                    break;

                case EIconPassiveAnimation.None:
                    myIcon.SetScale(new Vector2(1.0f, 1.0f));
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #11
0
        public override void Initialize()
        {
            base.Initialize();

            frameCounter = new FrameCounter();
            enemies      = new List <Sprite>();
        }
Beispiel #12
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            IsFixedTimeStep       = false;
            CurrentGraphicsDevice = GraphicsDevice;
            ViewportWidth         = GraphicsDevice.Viewport.Width;
            ViewportHeight        = GraphicsDevice.Viewport.Height;


            FileLoader.Initialize();
            frameCounter = new FrameCounter();

            client = new GameClient();
            client.Connect();

            InputManager.LeftMouseButtonState.DistinctUntilChanged().Subscribe((mouseEvent) =>
            {
                if (mouseEvent.Pressed)
                {
                    client.CreateGame();
                }
            });

            InputManager.RightMouseButtonState.DistinctUntilChanged().Subscribe((mouseEvent) =>
            {
                if (mouseEvent.Pressed)
                {
                    client.JoinGame();
                }
            });

            base.Initialize();
        }
Beispiel #13
0
 public GameScreen(TileGame game)
 {
     camera       = new Camera2D(game);
     map          = new Map();
     player       = new Player();
     frameCounter = new FrameCounter();
 }
Beispiel #14
0
        public void Init(ContentManager content)
        {
            GameManager.Game.Camera = new Camera2D(GameManager.Game.GraphicsDevice);
            GameManager.Game.Player = new Player.Player();
            GameManager.Game.Player.Init(content);
            fpsCounter = new FrameCounter();

            GameManager.Game.Camera.ZoomIn(1);

            ConnectToServer(ip);
            GameManager.Game.NetworkParser    = new NetworkParser(client);
            GameManager.Game.NetworkParser.IP = ip;
            player = new NetworkPlayer();

            GameManager.Game.Inventory = new UI.InventoryUI();
            GameManager.Game.Stats     = new UI.StatsOverlay();
            UI.Add(GameManager.Game.Stats);
            UI.Add(GameManager.Game.Inventory);

            playerHull = new Hull(new Vector2(12, 0), new Vector2(12, 55), new Vector2(14, 58), new Vector2(16, 59), new Vector2(20, 59), new Vector2(26, 56), new Vector2(37, 56), new Vector2(43, 59), new Vector2(47, 59), new Vector2(49, 58), new Vector2(51, 55), new Vector2(51, 0))
            {
                Scale  = new Vector2(1),
                Origin = new Vector2(32)
            };


            mouseLight = new PointLight();
            mouseLight.CastsShadows = true;
            mouseLight.ShadowType   = ShadowType.Solid;
            mouseLight.Scale        = new Vector2(100);
            mouseLight.Intensity    = 0.5f;
            GameManager.Game.Penumbra.Hulls.Add(playerHull);
            GameManager.Game.Penumbra.Lights.Add(mouseLight);
        }
Beispiel #15
0
        protected override void Update(GameTime gameTime)
        {
            FrameCounter.Update(gameTime);
            float dt = (float)gameTime.ElapsedGameTime.TotalSeconds;

            TaskManager.Update(dt);

            Input.Update(dt);

            Client.Update(dt);

            if (Client.IsConnected)
            {
                UpdateGame(dt);
            }
            else if (Client.IsConnecting)
            {
                UpdateConnecting(dt);
            }
            else
            {
                UpdateUnconnected(dt);
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Client.Disconnect();
                Exit();
            }

            base.Update(gameTime);
        }
Beispiel #16
0
        protected virtual void DrawDebugData()
        {
            string networkData  = "";
            string graphicsData = "";


            graphicsData = String.Format("fps: {0} ",
                                         Math.Floor(FrameCounter.GetAverageFramerate())
                                         );
            if (Client.IsConnected)
            {
                networkData = String.Format(
                    "ping: {0}ms ent: {1} download {2}KiB upload {3}KiB, avg {4}KiB/s {5}KiB/s",
                    Math.Floor(ping * 1000),
                    World.entities.Count,
                    Math.Floor(Client.DataTotalIn / 1000.0),
                    Math.Floor(Client.DataTotalOut / 1000.0),
                    Math.Floor(Client.DataAverageIn / 100) / 50,
                    Math.Floor(Client.DataAverageOut / 100) / 50
                    );
            }

            SpriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, Camera.ScreenSpaceMatrix);
            TextRenderer.Print(SpriteBatch, networkData, new Vector2(0, 0), Color.White);
            TextRenderer.Print(SpriteBatch, graphicsData, new Vector2(0, 16), Color.White);
            SpriteBatch.End();
        }
Beispiel #17
0
 public ShotState(BaseCharacter parent, YugiChargeSkillState parentState)
     : base(parent)
 {
     this.parent = parentState;
     frame = new FrameCounter(180);
     shotInterval = new FrameCounter(3);
 }
Beispiel #18
0
 public ShotState(BaseCharacter parent, YugiChargeSkillState parentState)
     : base(parent)
 {
     this.parent  = parentState;
     frame        = new FrameCounter(180);
     shotInterval = new FrameCounter(3);
 }
Beispiel #19
0
        public bool Equals(SimpleVariables other)
        {
            if (other == null)
            {
                return(false);
            }

            return(VersionId.Equals(other.VersionId) &&
                   LastMissionPassedName.Equals(other.LastMissionPassedName) &&
                   MissionPackGame.Equals(other.MissionPackGame) &&
                   CurrLevel.Equals(other.CurrLevel) &&
                   CameraPosition.Equals(other.CameraPosition) &&
                   MillisecondsPerGameMinute.Equals(other.MillisecondsPerGameMinute) &&
                   LastClockTick.Equals(other.LastClockTick) &&
                   GameClockMonths.Equals(other.GameClockMonths) &&
                   GameClockDays.Equals(other.GameClockDays) &&
                   GameClockHours.Equals(other.GameClockHours) &&
                   GameClockMinutes.Equals(other.GameClockMinutes) &&
                   GameClockDayOfWeek.Equals(other.GameClockDayOfWeek) &&
                   StoredGameClockMonths.Equals(other.StoredGameClockMonths) &&
                   StoredGameClockDays.Equals(other.StoredGameClockDays) &&
                   StoredGameClockHours.Equals(other.StoredGameClockHours) &&
                   StoredGameClockMinutes.Equals(other.StoredGameClockMinutes) &&
                   ClockHasBeenStored.Equals(other.ClockHasBeenStored) &&
                   CurrPadMode.Equals(other.CurrPadMode) &&
                   HasPlayerCheated.Equals(other.HasPlayerCheated) &&
                   TimeInMilliseconds.Equals(other.TimeInMilliseconds) &&
                   TimeScale.Equals(other.TimeScale) &&
                   TimeStep.Equals(other.TimeStep) &&
                   TimeStepNonClipped.Equals(other.TimeStepNonClipped) &&
                   FrameCounter.Equals(other.FrameCounter) &&
                   OldWeatherType.Equals(other.OldWeatherType) &&
                   NewWeatherType.Equals(other.NewWeatherType) &&
                   ForcedWeatherType.Equals(other.ForcedWeatherType) &&
                   WeatherInterpolation.Equals(other.WeatherInterpolation) &&
                   WeatherTypeInList.Equals(other.WeatherTypeInList) &&
                   Rain.Equals(other.Rain) &&
                   CameraCarZoomIndicator.Equals(other.CameraCarZoomIndicator) &&
                   CameraPedZoomIndicator.Equals(other.CameraPedZoomIndicator) &&
                   CurrArea.Equals(other.CurrArea) &&
                   InvertLook4Pad.Equals(other.InvertLook4Pad) &&
                   ExtraColour.Equals(other.ExtraColour) &&
                   ExtraColourOn.Equals(other.ExtraColourOn) &&
                   ExtraColourInterpolation.Equals(other.ExtraColourInterpolation) &&
                   ExtraColourWeatherType.Equals(other.ExtraColourWeatherType) &&
                   WaterConfiguration.Equals(other.WaterConfiguration) &&
                   LARiots.Equals(other.LARiots) &&
                   LARiotsNoPoliceCars.Equals(other.LARiotsNoPoliceCars) &&
                   MaximumWantedLevel.Equals(other.MaximumWantedLevel) &&
                   MaximumChaosLevel.Equals(other.MaximumChaosLevel) &&
                   GermanGame.Equals(other.GermanGame) &&
                   FrenchGame.Equals(other.FrenchGame) &&
                   NastyGame.Equals(other.NastyGame) &&
                   CinematicCamMessagesLeftToDisplay.Equals(other.CinematicCamMessagesLeftToDisplay) &&
                   TimeLastSaved.Equals(other.TimeLastSaved) &&
                   TargetMarkerHandle.Equals(other.TargetMarkerHandle) &&
                   HasDisplayedPlayerQuitEnterCarHelpText.Equals(other.HasDisplayedPlayerQuitEnterCarHelpText) &&
                   AllTaxisHaveNitro.Equals(other.AllTaxisHaveNitro) &&
                   ProstiutesPayYou.Equals(other.ProstiutesPayYou));
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            graphics.PreferredBackBufferWidth       = mWindowBounds[0];
            graphics.PreferredBackBufferHeight      = mWindowBounds[1];
            graphics.SynchronizeWithVerticalRetrace = false;
            graphics.ApplyChanges();

            this.IsFixedTimeStep   = true;
            this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 1000 / MAX_FPS);

            InputManager.Init();
            FrameCounter.Init();

            // initializing the camera with default values
            //mCamera.Position = new Vector2(0, 0);
            //mCamera.Zoom = CAMERA_ZOOM;
            mCamera = new Camera(new Vector2(0, 0), GraphicsDevice.Viewport.Bounds.Size, CAMERA_ZOOM);

            mWorld = new World(mWorldBounds);
            mWorld.Generate(out mRenderDebugInfo.numTilesTotal);

            base.Initialize();
        }
Beispiel #21
0
        public bool Equals(SimpleVariables other)
        {
            if (other == null)
            {
                return(false);
            }

            return(CurrentLevel.Equals(other.CurrentLevel) &&
                   CurrentArea.Equals(other.CurrentArea) &&
                   Language.Equals(other.Language) &&
                   MillisecondsPerGameMinute.Equals(other.MillisecondsPerGameMinute) &&
                   LastClockTick.Equals(other.LastClockTick) &&
                   GameClockHours.Equals(other.GameClockHours) &&
                   GameClockMinutes.Equals(other.GameClockMinutes) &&
                   GameClockSeconds.Equals(other.GameClockSeconds) &&
                   TimeInMilliseconds.Equals(other.TimeInMilliseconds) &&
                   TimeScale.Equals(other.TimeScale) &&
                   TimeStep.Equals(other.TimeStep) &&
                   TimeStepNonClipped.Equals(other.TimeStepNonClipped) &&
                   FramesPerUpdate.Equals(other.FramesPerUpdate) &&
                   FrameCounter.Equals(other.FrameCounter) &&
                   OldWeatherType.Equals(other.OldWeatherType) &&
                   NewWeatherType.Equals(other.NewWeatherType) &&
                   ForcedWeatherType.Equals(other.ForcedWeatherType) &&
                   WeatherTypeInList.Equals(other.WeatherTypeInList) &&
                   WeatherInterpolationValue.Equals(other.WeatherInterpolationValue) &&
                   CameraPosition.Equals(other.CameraPosition) &&
                   CameraModeInCar.Equals(other.CameraModeInCar) &&
                   CameraModeOnFoot.Equals(other.CameraModeOnFoot) &&
                   ExtraColor.Equals(other.ExtraColor) &&
                   IsExtraColorOn.Equals(other.IsExtraColorOn) &&
                   ExtraColorInterpolation.Equals(other.ExtraColorInterpolation) &&
                   Brightness.Equals(other.Brightness) &&
                   DisplayHud.Equals(other.DisplayHud) &&
                   ShowSubtitles.Equals(other.ShowSubtitles) &&
                   RadarMode.Equals(other.RadarMode) &&
                   BlurOn.Equals(other.BlurOn) &&
                   UseWideScreen.Equals(other.UseWideScreen) &&
                   MusicVolume.Equals(other.MusicVolume) &&
                   SfxVolume.Equals(other.SfxVolume) &&
                   RadioStation.Equals(other.RadioStation) &&
                   StereoOutput.Equals(other.StereoOutput) &&
                   PadMode.Equals(other.PadMode) &&
                   InvertLook.Equals(other.InvertLook) &&
                   UseVibration.Equals(other.UseVibration) &&
                   SwapNippleAndDPad.Equals(other.SwapNippleAndDPad) &&
                   HasPlayerCheated.Equals(other.HasPlayerCheated) &&
                   AllTaxisHaveNitro.Equals(other.AllTaxisHaveNitro) &&
                   TargetIsOn.Equals(other.TargetIsOn) &&
                   TargetPosition.Equals(other.TargetPosition) &&
                   PlayerPosition.Equals(other.PlayerPosition) &&
                   TrailsOn.Equals(other.TrailsOn) &&
                   TimeStamp.Equals(other.TimeStamp) &&
                   Unknown78hPS2.Equals(other.Unknown78hPS2) &&
                   Unknown7ChPS2.Equals(other.Unknown7ChPS2) &&
                   Unknown90hPS2.Equals(other.Unknown90hPS2) &&
                   UnknownB8hPSP.Equals(other.UnknownB8hPSP) &&
                   UnknownD8hPS2.Equals(other.UnknownD8hPS2) &&
                   UnknownD9hPS2.Equals(other.UnknownD9hPS2));
        }
Beispiel #22
0
        protected sealed override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            if (VideoConfiguration.RESOLUTION_WIDTH == 0 || VideoConfiguration.RESOLUTION_HEIGHT == 0)
            {
                VideoConfiguration.RESOLUTION_WIDTH  = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                VideoConfiguration.RESOLUTION_HEIGHT = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            }

            ApplyVideoConfiguration();

            Config.ExitAction = Exit;

            Camera = new Camera(graphics)
            {
                Limits = new Rectangle(0, 0, 1100, 1700)
            };

            SceneManager = new SceneManager(Camera, graphics.GraphicsDevice);

            font = Content.Load <SpriteFont>("DefaultFont");

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

            frameCounter = new FrameCounter();

            LoadGameContent();
        }
Beispiel #23
0
        public BlowLogic(MoveParameter m, GameObject target, FrameCounter sync)
        {
            move = m;

            blow = target;

            framecounter = sync;
        }
Beispiel #24
0
        public GameWindow()
        {
            graphics     = new GraphicsDeviceManager(this);
            FrameCounter = new FrameCounter();

            Content.RootDirectory = "Content";
            base.IsFixedTimeStep  = false;
        }
Beispiel #25
0
 public GameGusto()
 {
     _frameCounter = new FrameCounter();
     graphics      = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth  = GameOptions.PrefferedBackBufferWidth;
     graphics.PreferredBackBufferHeight = GameOptions.PrefferedBackBufferHeight;
     Content.RootDirectory = "Content";
 }
Beispiel #26
0
 public GameEngine()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     Systems       = new SystemManager();
     _frameCounter = new FrameCounter();
     _entities     = new Dictionary <string, Entity> ();
 }
        public BlowLogic(MoveParameter m, GameObject target, FrameCounter sync)
        {
            move = m;

            blow = target;

            framecounter = sync;
        }
Beispiel #28
0
        /// <summary>
        /// Starts the internal FPS measuring.
        /// </summary>
        public void Start()
        {
            _frameCounter = new FrameCounter();

            _sWatch = Stopwatch.StartNew();

            Running = true;
        }
Beispiel #29
0
 public DebugScene() : base(nameof(DebugScene))
 {
     //FPS Counter
     _frameCounter = new FrameCounter();
     FPS           = "0";
     MousePos      = "Mouse Position - X: 0, Y: 0";
     KeysPressed   = "Keys Pressed:";
 }
 public HomingState(BaseAttack parent, Transform _target, Options option)
     : base(parent)
 {
     target = _target;
     framecount = new FrameCounter(option.time);
     homingLevel = option.level;
     interval = option.interval;
 }
 public HomingState(BaseAttack parent, Transform _target, Options option)
     : base(parent)
 {
     target      = _target;
     framecount  = new FrameCounter(option.time);
     homingLevel = option.level;
     interval    = option.interval;
 }
Beispiel #32
0
    protected override void Initialize()
    {
        timeTracker  = GetComponent <TimeTracker>();
        deltaTracker = GetComponent <DeltaTracker>();
        frameCounter = GetComponent <FrameCounter>();
        namedTallier = GetComponent <NamedTallier>();

        progressTracker = GetComponentInChildren <ProgressTracker>();
    }
Beispiel #33
0
        //public ICamera camera { get; private set; }


        public CommonResources()
        {
            Components.Add(fontLucidaConsole = new Font(@"Resources\Font\lucon.ttf_sdf.1024.png", @"Resources\Font\lucon.ttf_sdf.1024.txt"), 1);
            Components.Add(frameCounter      = new FrameCounter(fontLucidaConsole)
            {
                TextSize = 0.0006f
            }, 2);
            Components.Add(text = new TextManager("tm", fontLucidaConsole), 2);
            //Components.Add(camera = new WalkCamera())
        }
Beispiel #34
0
        public override void Initialize()
        {
            base.Initialize();

            frameCounter        = new FrameCounter();
            enemies             = new List <Sprite>();
            backgroundParticles = new List <ParticleEmitter>();
            goldenFishs         = new List <Sprite>();
            triggers            = new List <Trigger>();
            SFX = new Dictionary <string, SoundEffect>();
        }
        private void DrawHud(GameTime gameTime)
        {
            spriteBatch.Begin();
            float fps = FrameCounter.GetAverageFramerate();

            spriteBatch.DrawString(mDebugFont, "FPS: " + fps.ToString("N0"), new Vector2(10, 10), Color.White);
            string tileDebug = "Tiles Drawn: " + mRenderDebugInfo.numTilesDrawn + " / " + mRenderDebugInfo.numTilesTotal + " ( " + ((float)mRenderDebugInfo.numTilesDrawn / (float)mRenderDebugInfo.numTilesTotal * 100.0f).ToString("N0") + " % )";

            spriteBatch.DrawString(mDebugFont, tileDebug, new Vector2(10, 25), Color.White);
            spriteBatch.End();
        }
        private void DrawGame(GameTime gameTime)
        {
            FrameCounter.onDraw((float)gameTime.ElapsedGameTime.Milliseconds / 1000);
            spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, mCamera.getView());

            mWorld.Draw(spriteBatch, mCamera, graphics.GraphicsDevice.Viewport.Bounds, ref mRenderDebugInfo.numTilesDrawn);

            Rectangle gridRect = new Rectangle(-128, -128, 256, 256);

            spriteBatch.Draw(mGridTexture, gridRect, Color.White);

            spriteBatch.End();
        }
        public CharacterChargeBlowState(Character parent)
            : base(parent)
        {
            framecounter = new FrameCounter(7);
            var move = new MoveParameter(character.frontDirection, 7F);
            var blow = (GameObject.Instantiate(AttackLibrary.GetInstance.chargeBlow) as GameObject)
                .GetComponent<ChargeBlow>();

            blow.parent = character;
            blow.syncCounter = framecounter;
            SoundManager.Play(SoundManager.attackHeavy);

            logic = new BlowLogic(move, blow.gameObject, framecounter);
            parameter.invincibly.Start(7, false);
        }
Beispiel #38
0
 // Use this for initialization
 void Start()
 {
     frameCounter = (FrameCounter)transform.parent.gameObject.GetComponent(typeof(FrameCounter));
 }
Beispiel #39
0
 public FallState(BaseCharacter parent)
     : base(parent)
 {
     framecounter = new FrameCounter(60);
 }
 public MurasaSkillState(Character parent)
     : base(parent)
 {
     framecounter = new FrameCounter(20);
     parameter.stamina.quantity -= 10;
 }
Beispiel #41
0
 public WaitState(BaseCharacter parent, YugiChargeSkillState parentState)
     : base(parent)
 {
     frame = new FrameCounter(180);
     this.parent = parentState;
 }
 protected virtual void Init()
 {
     fix = new MoveFix(1F);
     framecounter = new FrameCounter(8);
 }
 public BoxStayState(BaseBox parent)
     : base(parent)
 {
     counter = new FrameCounter(10000);
 }
 public ConditionMunenMusou(Character parent)
     : base(parent)
 {
     totalDamage = new Damage(60, false, 0, Random.Range(0, 360), true);
     framecounter = new FrameCounter(600);
 }
Beispiel #45
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (cbMonitors.Items.Count == 0)
            {
                MessageBox.Show("No monitor detected.\nPlease wait till the client sends a list with available monitors.",
                    "Starting failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            _frameCounter = new FrameCounter();
            _sWatch = Stopwatch.StartNew();

            ToggleControls(false);

            new Core.Packets.ServerPackets.GetDesktop(barQuality.Value, cbMonitors.SelectedIndex, RemoteDesktopAction.Start).Execute(_connectClient);
        }
Beispiel #46
0
 protected virtual void Init()
 {
     framecounter = new FrameCounter(600);
     baseParameter = new BaseParameter(sprite);
 }
Beispiel #47
0
 public EndState(MainGameManager manager)
 {
     parent = manager;
     frame = new FrameCounter(180);
 }
 public ResultState(MainGameManager manager)
 {
     parent = manager;
     frame = new FrameCounter(300);
 }
Beispiel #49
0
        public void update(String name, GameTime gameTime)
        {
            if (!d.ContainsKey(name))
            {
                d[name] = new FrameCounter();
            }

            FrameCounter fc = d[name];
            fc.elapsedTime += gameTime.ElapsedGameTime;

            if (fc.elapsedTime > TimeSpan.FromSeconds(1))
            {
                fc.elapsedTime -= TimeSpan.FromSeconds(1);
                fc.frameRate = fc.frameCounter;
                fc.frameCounter = 1;
            }
            fc.frameCounter++;
        }
 protected override void Init()
 {
     framecounter = new FrameCounter(4);
     fix = new MoveFix(2F);
 }
 public BlinkParameter(UISprite sprite)
 {
     targetSprite = sprite;
     counter = new FrameCounter(3);
 }