public MapEventIO() { Components = new List <MapEventComponentIO>(); Actors = new List <ActorIO>(); CharacterImagePaths = new List <string>(); Camera = new CameraIO(); }
public Projection(Data.Setup s) { InitializeComponent(); setup = s; rectangles = new List <Rectangle>(); rectanglesUnscaled = new List <Rectangle>(); camera = new CameraIO(setup); pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; Application.Idle += new EventHandler(this.Application_Idle); }
public MainWindow() { InitializeComponent(); setup = new Data.Setup(); powerupsTimer.Elapsed += new ElapsedEventHandler(Timer_Elapsed); powerupsTimer.Interval = 5000; powerupsTimer.AutoReset = true; // Start setup - first screen: number of players + name Window window1 = new Window { Title = "Pong setup - Names", Content = new firstStep(setup), Width = 600, Height = 400, WindowStartupLocation = WindowStartupLocation.CenterScreen }; window1.ShowDialog(); window1.Close(); // Continue setup - second screen: select camera Window window2 = new Window { Title = "Pong setup - Camera Setup", Content = new secondStep(setup), Width = 600, Height = 800, WindowStartupLocation = WindowStartupLocation.CenterScreen }; window2.ShowDialog(); window2.Close(); // Continue setup - third screen: select hand zones Window window3 = new Window { Title = "Pong setup - Hand Zone Selection", Content = new thirdStep(setup), Width = 600, Height = 700, WindowStartupLocation = WindowStartupLocation.CenterScreen }; window3.ShowDialog(); window3.Close(); // Continue + exit setup - fourth screen: general settings Window window4 = new Window { Title = "Pong setup - General settings", Content = new fourthStep(setup), Width = 600, Height = 700, WindowStartupLocation = WindowStartupLocation.CenterScreen }; window4.ShowDialog(); window4.Close(); this.Closed += new EventHandler(Window_Closed); this.KeyDown += new KeyEventHandler(Window_KeyDown); this.MouseDoubleClick += new MouseButtonEventHandler(Window_DoubleClick); camera = new CameraIO(setup); timeRemaining = setup.TimeLimit * 60; balls = new List <Ball>(); players = Helper.CreatePlayers(setup.Rectangles, (int)this.Width, (int)this.Height, camera.Size, setup); goals = Helper.GetGoals(setup.Rectangles, (int)this.Width, (int)this.Height, camera.Size); balls.Add(Helper.CreateBall(setup.StartVelocity, (int)(this.Width / 2) - 20, (int)(this.Height / 2) - 20)); powerups = new List <PowerUp>(); for (int i = 0; i < players.Count; i++) { Player p = players[i]; Canvas.SetLeft(p.ScoreLabel, (this.Width / (players.Count + 1)) * (i + 1)); Canvas.SetTop(p.ScoreLabel, 10); World.Children.Add(p.Beam.Shape); World.Children.Add(p.ScoreLabel); } fullscreen = false; foreach (Ball ball in balls) { World.Children.Add(ball.Shape); } startWidth = this.Width; startHeight = this.Height; // Open gamedata gameData = new gameData(balls, players, powerups, setup); gameData.Show(); gameData.SendToBack(); }