public Board(string texName, UnitCamera cam) : base(Constants.TIME_TICKS_EVENT) { var tex = XNADevicesManager.Instance.ContentManager.Load<Texture2D>(texName); _unitCam = cam; _sprite = new Sprite(tex); _sprite.DrawRectangle = new Rectangle(0, 0, tex.Width, tex.Height); _sprite.IsVisible = false; _fade = new Fade(0.0f, 1.0f, 1000); _fade.Target = _sprite; _scale = new Scale(0.2f, 1.0f, 0.2f, 1.0f, 1000); _scale.Target = _sprite; }
public Logo(string texName, UnitCamera cam) : base(Constants.TIME_TICKS_EVENT) { var tex = XNADevicesManager.Instance.ContentManager.Load<Texture2D>(texName); _unitCam = cam; _sprite = new Sprite(tex); _sprite.DrawRectangle = new Rectangle(0, 0, tex.Width, tex.Height); _scale = new Scale(0.2f, 1.0f, 0.2f, 1.0f, 1500); _scale.EaseFunction = EaseFunction.Out_Elastic; _scale.Target = _sprite; _timer = new Timer(2000); _timer.OnTimer += _timer_OnTimer; }
public override void Initialize() { _world = new World(new Vector2(0, 0), EventManager); //Player1 var def = XmlHelper.LoadFromFile<CharacterDef>(@"Data\Hua.xml"); def.ScaleX = 1.3f; def.ScaleY = 1.3f; def.Width *= 1.3f; def.Height *= 1.3f; def.SoundEffects = null; _player1 = _world.CreateCharacter(def); _player1.Sprite.IsVisible = false; Root.Add(_player1.Sprite); _unitCam = new UnitCamera(_player1, new Vector2(40.0f, 40.0f), new Vector2(80.0f, 80.0f), new Vector2(-9550, 465), new Vector2(9550, -9550), new Vector2(190, 190), new Vector3(0.0f, 120.0f, 500.0f)); }
public override void Initialize() { //print log on screen. Root.Add(LoggerManager.Instance.GetLogger("XNALogger") as DrawNode); _world = new World(new Vector2(0, -10.0f), EventManager); _AIManager = new AIManager(); EventManager.AddEventType(_AIManager); LoadAudition(); LoadShouldContact(); LoadRalations(); LoadTerrain(); LoadPlayer(); LoadDecorations(); LoadBackground(); LoadEnemies(); LoadBoss(); _unitCam = new UnitCamera(_player1, new Vector2(40.0f, 40.0f), new Vector2(80.0f, 80.0f), new Vector2(-9550, 465), new Vector2(9550, -9550), new Vector2(190, 190), new Vector3(0.0f, 120.0f, 500.0f)); EventManager.Register(_world); EventManager.Register(_unitCam); LoadIntro(); }