public DummyPlayer(Game game, Character character, Camera2D cam) : base(game, cam) { this.cam = null; userInterface = null; userInput = null; }
public Player(Game game, Character character, Camera2D cam, KryptonEngine krypton) { this.game = game; this.krypton = krypton; this.character = character; this.creature = new WheeledCreature(game); userInterface = new UserInterface(game); this.cam = cam; userInput = new UserInput(this); wards = new List<Ward>(); light = new Krypton.Lights.Light2D() { Texture = Krypton.LightTextureBuilder.CreatePointLight(this.game.GraphicsDevice, 512), Range = ConvertUnits.ToSimUnits(1200), Intensity = float.MaxValue, Position = Vector2.Zero, }; krypton.Lights.Add(light); }
public virtual void Initialize(Character character) { this.character = character; character.Initialize(); userInterface.Initialize(this); }
public override void Initialize(Character character) { this.character = character; character.Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Initialize Physics Objects world = new World(new Vector2(0, 20)); debugViewXNA = new DebugViewXNA(world); debugViewXNA.AppendFlags(DebugViewFlags.Shape); debugViewXNA.AppendFlags(DebugViewFlags.AABB); debugViewXNA.AppendFlags(DebugViewFlags.CenterOfMass); debugViewXNA.AppendFlags(DebugViewFlags.DebugPanel); //Initialize Singleton Objects spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), spriteBatch); font = Content.Load<SpriteFont>("myFont"); staticEntities = new List<Entity>(); //Set camera variables cam = new Camera2D(GraphicsDevice); cam.Zoom = 0.7f; Services.AddService(typeof(Camera2D), cam); // cam.Zoom = 0.3f; //Initialize Entities player1 = new Player(this, ashe, cam, krypton); player2 = new DummyPlayer(this, ashe2, cam); //Initialize Characters, they must be created after the players but before player.Initialize() ashe = new Ashe(player1); ashe2 = new Ashe(player2); player2.Initialize(ashe2); player2.setTeam(Creature.Team.Red); player1.Initialize(ashe); player1.setTeam(Creature.Team.Blue); krypton.Initialize(); //Initialize Test Objects base.Initialize(); }