Exemple #1
0
        private const float kGoldenRatio         = 1.61803398874989484820458683436f; //Esoteric factor used to decouple horizontal and vertical frequencies

        public FlyNoiseSystem(FrameTime time, FlyData flyData, FlyNoiseData noiseData)
        {
            mFlyNoiseData     = noiseData;
            mRandom           = new Random();
            mTime             = time;
            mNoiseStateBuffer = new FlyNoiseState[flyData.MaxActiveFlies];
            mPositionBuffer   = new Position[flyData.MaxActiveFlies];
        }
Exemple #2
0
        protected override void LoadContent()
        {
            FrogData frogData = Content.Load <FrogData>("Frog");
            PondData pondData = Content.Load <PondData>("Pond");
            FlyData  flyData  = Content.Load <FlyData>("Fly");
            FlyDirectionChangeData changeData    = Content.Load <FlyDirectionChangeData>("DirectionChange");
            FlyNoiseData           noiseData     = Content.Load <FlyNoiseData>("FlyNoise");
            FrogAnimationData      animationData = Content.Load <FrogAnimationData>("FrogAnimation");
            Texture2D frogSprite = Content.Load <Texture2D>("Ranita");

            SpriteFont uiFont = Content.Load <SpriteFont>("GameUI");

            System.Diagnostics.Debug.Assert(IsFixedTimeStep);
            RanitasDependencies dependencies = new RanitasDependencies((float)TargetElapsedTime.TotalSeconds, pondData, frogData, flyData, changeData, noiseData, animationData, frogSprite, mGraphics.GraphicsDevice, uiFont);

            mSim = new ECSSim(dependencies);
            mSim.Initialize();
        }