Ejemplo n.º 1
0
 public override void TimeElapse(WorldTime WTime)
 {
     //ToDo: Problem here is that the bone doesn't warn the asset that he has changed,
     //So a check has to be done each cycle
     //probably the best is that the asset should make the check
     UpdateBounds();
 }
Ejemplo n.º 2
0
        private void OnTimeElapseHandler(WorldTime wTime)
        {
            if (Particle == null) return;

            if(!Particle.IsAlive)
                Destroy();
        }
Ejemplo n.º 3
0
 public void Update(WorldTime WTime)
 {
     var totalSeconds = (float) WTime.ElapsedSinceLastTime.TotalSeconds;
     //_world.Step(totalSeconds);
     foreach (var body in _fakePhysicsSimulationBodies)
     {
         body.Position = body.Position + (body.Direction*body.Velocity*totalSeconds);
     }
 }
Ejemplo n.º 4
0
 public void Update(WorldTime WTime)
 {
     if (!UpdateWorld) return;
     if (ActiveScene == null) return;
     ActiveScene.Update(WTime);
 }
Ejemplo n.º 5
0
 public override void TimeElapse(WorldTime WTime)
 {
     ParticleEffect.Position = Owner.Transformation.Translation.ToVector2();
     ParticleEffect.TimeElapse(WTime.ElapsedSinceLastTime);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            var keyState = Keyboard.GetState();
            //Keys[] k = keyState.GetPressedKeys
            // TODO: Add your update logic here

            base.Update(gameTime);

            var wt = new WorldTime(gameTime.TotalGameTime, gameTime.ElapsedGameTime);

            GameWorld.Update(wt);

            if (OnUpdate != null)
                OnUpdate(wt);
        }
Ejemplo n.º 7
0
        //public void Draw(GraphicsDevice gd)
        //{
        //    if (rectangle == null)
        //    {
        //        rectangle = new Texture2D(gd, 2, 2);
        //        rectangle.SetData(new[] { Color.White, Color.Red, Color.Green, Color.Blue });
        //    }
        //    gd.Clear(Color.CornflowerBlue);
        //    var sb = new SpriteBatch(gd);
        //    sb.Begin();
        //    // Option One (if you have integer size and coordinates)
        //    sb.Draw(rectangle, new Rectangle(10, 20, 80, 30), null,
        //            Color.Chocolate, 0, Vector2.Zero, SpriteEffects.FlipVertically, 0);
        //    // Option Two (if you have floating-point coordinates)
        //    //spriteBatch.Draw(whiteRectangle, new Vector2(10f, 20f), null,
        //    //        Color.Chocolate, 0f, Vector2.Zero, new Vector2(80f, 30f),
        //    //        SpriteEffects.None, 0f);
        //    sb.End();
        //}
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsContext.Clear(Color.CornflowerBlue);

            var render = GraphicsContext.GetRenderer();
            render.PreRender();

            if (OnDraw != null)
            {
                var wt = new WorldTime(gameTime.TotalGameTime, gameTime.ElapsedGameTime);
                OnDraw(render, wt);
            }
            //_asset.Render(render);
            GameWorld.RenderActiveScene();

            render.PostRender();
            base.Draw(gameTime);
        }
Ejemplo n.º 8
0
 public abstract void TimeElapse(WorldTime WTime);
Ejemplo n.º 9
0
 public override void TimeElapse(WorldTime WTime)
 {
 }
Ejemplo n.º 10
0
 public override sealed void TimeElapse(WorldTime WTime)
 {
     //Components.TimeElapse(WTime);
     if (_renderableAsset != null)
         _renderableAsset.TimeElapse(WTime);
     if (OnTimeElapse != null)
         OnTimeElapse(WTime);
 }
Ejemplo n.º 11
0
 protected virtual void PerformDecision(WorldTime WTime)
 {
 }
Ejemplo n.º 12
0
 public override void TimeElapse(WorldTime WTime)
 {
     base.TimeElapse(WTime);
     PerformDecision(WTime);
 }
Ejemplo n.º 13
0
 public override void TimeElapse(WorldTime WTime)
 {
     RenderingOffset = Bone.AbsolutePosition;
     Rotation = Bone.Rotation;
 }
Ejemplo n.º 14
0
 public virtual void TimeElapse(WorldTime WTime)
 {
 }