/// <summary> /// Constructeur /// </summary> public Game() { size = new Size(500, 500); ball = new Views.Ball(); bar = new Views.Bar(); state = new StartState(this); points = 0; }
/// <summary> /// Constructeur /// </summary> /// <param name="context">Le modèle du jeu</param> public PlayState(Models.Game context) { this.context = context; ball = context.Ball; bar = context.Bar; bricks = context.Bricks; ball.SetDirection(0, context.Size.Height / 100); }
/// <summary> /// Constructeur /// </summary> /// <param name="context">Le modèle du jeu</param> public StartState(Models.Game context) { this.context = context; this.ball = context.Ball; this.bar = context.Bar; bar.SetPosition((context.Size.Width / 2) - (bar.Size.Width / 4), bar.Position.Y); this.context.Bricks = BrickCreator.NextSchema(); context.Refresh(); }