protected override void OnLoadContent() { // Test paralax para = new Parallax(); ratioX = 0; AddChild(para); CCS = new CurrentChampionState(1000,100); //AddChild(new GameUI(CCS),10); ESCMenu menu = new ESCMenu(); AddChild(menu, 5); menu.SetPositionInScreenPercent(50, 50); champSprite = new DrawableChampionSprite(ChampionAnimation.idle, ChampionTypes.ManMega, ChampionsInfo) { Position = new Vector2(200f, 300f) }; AddChild(champSprite); AS = new ActionSequence(ActionSequence.INFINITE_SEQUENCE, new ActionMoveBy(new TimeSpan(0,0,1), new Vector2(100, 100)), new ActionMoveBy(new TimeSpan(0,0,1), new Vector2(-100, -100))); champSprite.PerformAction(AS); DrawableTriangle tr = new DrawableTriangle(true); tr.Ascendant = false; tr.Tint = Color.Blue; tr.Scale = new Vector2(1f,2f); //Test particle /*ParticleSystem sys = new ParticleSystem(Content, 1000, null); sys.Position = new Vector2(100, 100); AddChild(sys);*/ //AddChild(new PingCounter(() => Client.Instance.GetPing().TotalMilliseconds)); //inputManager.RegisterEvent(InputActions.Spell1, new EventHandler(Jump)); inputManager.RegisterEvent(InputActions.Spell3, new EventHandler(Jump)); inputManager.RegisterEvent(InputActions.GoRight, (sender, e)=> { ratioX+=2; para.SetCurrentRatio(ratioX,0f); }); inputManager.RegisterEvent(InputActions.GoLeft, (sender, e)=> { ratioX-=2; para.SetCurrentRatio(ratioX,0f); }); //inputManager.RegisterEvent(InputActions.Jump, new EventHandler(Jump2)); DrawableCircle circle = new DrawableCircle(); circle.SetPositionRelativeToObject(champSprite, new Vector2(-150, -30)); AddChild(circle); //AddChild(new DeathScreen(10),11); }
public GameplayScreen(ContentManager content, Game game, Client client) : base(content, game) { Client = client; ChampionsInfo = new ChampionsInfo(); GameTime = null; TimeSinceLastInputSent = 0.0; Match = new GameMatch(Path.Combine("Content", MapLoader.MAIN_MAP_PATH)); LastStateUpdateData = new List<StateUpdateData>(); RemarkableEvents = new List<RemarkableEventData>(); Spells = new Dictionary<ulong, DrawableSpell>(); TimeOfLastStateUpdate = 0.0; Champions = new List<ClientChampion>(); GameWorld = new Container(); Structures = new List<DrawableStructure>(); Camera = new CameraService(); Services.AddService(typeof(CameraService), Camera); ((SoundService)Services.GetService(typeof(SoundService))).CameraService = Camera; Parallax = new Parallax(); KillDisplay = new KillDisplay(ChampionsInfo); GameScore = new GameScore(); Sound = (SoundService)Services.GetService(typeof(SoundService)); }