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(); }
private void OnTimeElapseHandler(WorldTime wTime) { if (Particle == null) return; if(!Particle.IsAlive) Destroy(); }
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); } }
public void Update(WorldTime WTime) { if (!UpdateWorld) return; if (ActiveScene == null) return; ActiveScene.Update(WTime); }
public override void TimeElapse(WorldTime WTime) { ParticleEffect.Position = Owner.Transformation.Translation.ToVector2(); ParticleEffect.TimeElapse(WTime.ElapsedSinceLastTime); }
/// <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); }
//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); }
public abstract void TimeElapse(WorldTime WTime);
public override void TimeElapse(WorldTime WTime) { }
public override sealed void TimeElapse(WorldTime WTime) { //Components.TimeElapse(WTime); if (_renderableAsset != null) _renderableAsset.TimeElapse(WTime); if (OnTimeElapse != null) OnTimeElapse(WTime); }
protected virtual void PerformDecision(WorldTime WTime) { }
public override void TimeElapse(WorldTime WTime) { base.TimeElapse(WTime); PerformDecision(WTime); }
public override void TimeElapse(WorldTime WTime) { RenderingOffset = Bone.AbsolutePosition; Rotation = Bone.Rotation; }
public virtual void TimeElapse(WorldTime WTime) { }