Exemplo n.º 1
0
        public override void Tick(double delta)
        {
            if (!game.World.HasBlocks)
            {
                return;
            }
            interp.AdvanceState();
            physics.UpdateVelocityState();

            ai.Tick(game.LocalPlayer);
            physics.PhysicsTick(ai.MoveVelocity);
            DoWallClimb();
            physics.DoEntityPush();

            interp.next.Pos = Position; Position = interp.prev.Pos;
            anim.UpdateAnimState(interp.prev.Pos, interp.next.Pos, delta);
        }
Exemplo n.º 2
0
        public override void Tick(double delta)
        {
            if (game.World.IsNotLoaded)
            {
                return;
            }
            this.OldVelocity = this.Velocity;
            interp.AdvanceState();
            physics.UpdateVelocityState();
            if (timer <= 4 && this.Velocity.Y <= 0)
            {
                this.Velocity.Y = 0;
            }
            Vector3 vel = new Vector3(0, 0, 0);

            physics.PhysicsTick(vel);


            timer += 1;

            interp.next.Pos = Position; Position = interp.prev.Pos;
            anim.UpdateAnimState(interp.prev.Pos, interp.next.Pos, delta);

            fuse            -= 1;
            this.ModelScale += 0.0015f;
            if (fuse <= 0)
            {
                if (Options.GetBool(OptionsKey.SingleplayerPhysics, true))
                {
                    int x = (int)this.Position.X;
                    int y = (int)this.Position.Y;
                    int z = (int)this.Position.Z;

                    game.tnt.Explode(tntPower, x, y, z);
                }
                game.Entities[this.ID] = null;
            }
        }