Example #1
0
        public void Initialize()
        {
            var state = new ActorState();

            state.Tics        = 1; state.Next = state; state.Prev = state;
            state.RotationSet = new RotationSet(new Sprite [] {
                new Sprite(TextureManager.LoadTexture("PLAYA1", false), System.Drawing.Color.White, new OpenTK.Vector2(12, 56), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA2", false), System.Drawing.Color.White, new OpenTK.Vector2(21, 55), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA3", false), System.Drawing.Color.White, new OpenTK.Vector2(26, 53), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA4", false), System.Drawing.Color.White, new OpenTK.Vector2(18, 52), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA5", false), System.Drawing.Color.White, new OpenTK.Vector2(12, 51), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA6", false), System.Drawing.Color.White, new OpenTK.Vector2(18, 52), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA7", false), System.Drawing.Color.White, new OpenTK.Vector2(26, 53), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
                new Sprite(TextureManager.LoadTexture("PLAYA8", false), System.Drawing.Color.White, new OpenTK.Vector2(21, 55), 0, 0, 0, OpenTK.Vector2.One, Renderer.Billboarding.Both),
            });

            var pawn = new PlayerPawn(state);

            pawn.SetMaxHealth(100);
            pawn.SetHeight(new Accum(56), false);
            pawn.SetRadius(new Accum(16), false);
            pawn.Camera.ViewHeight = new Accum(48);
            pawn.SetPosition(new CMath.Vector3k(new Accum(0), new Accum(0), new Accum(12)));
            pawn.SetFlags(ActorFlags.NoGravity);

            LocalPlayer = new Player();
            LocalPlayer.ControlInterface = new PlayerControl();
            LocalPlayer.Pawn             = pawn;
            pawn.Player = LocalPlayer;
            Players [0] = LocalPlayer;

            pawn.AddThinker();

            var actor = new Actor(state);

            actor.SetMaxHealth(100);
            actor.SetHeight(new Accum(56), false);
            actor.SetRadius(new Accum(16), false);
            actor.SetPosition(new CMath.Vector3k(new Accum(0), new Accum(150), new Accum(0)));
            actor.AddThinker();

            actor = new Actor(state);
            actor.SetMaxHealth(100);
            actor.SetHeight(new Accum(56), false);
            actor.SetRadius(new Accum(16), false);
            actor.SetPosition(new CMath.Vector3k(new Accum(0), new Accum(-150), new Accum(0)));
            actor.AddThinker();

            actor = new Projectile(state);
            actor.SetHeight(new Accum(16), false);
            actor.SetRadius(new Accum(16), false);
            actor.SetPosition(new CMath.Vector3k(new Accum(0), new Accum(250), new Accum(0)));
            actor.AddThinker();
            actor.SetVelocity(new Vector3k(Accum.Zero, new Accum(-25), Accum.Zero));
        }