Пример #1
0
 public Game(Content content, Renderer renderer, Time time, Score score, RabbitsGrid rabbits)
 {
     gameOverImage = content.Load<Image>("GameOver");
     this.time = time;
     this.score = score;
     this.renderer = renderer;
     this.rabbits = rabbits;
     rabbits.InitializeRabbits();
 }
Пример #2
0
 public RabbitsGrid(Content content, Renderer renderer, Time time, Score score)
     : base(GetColumns(renderer.Screen.Viewport), GetRows(renderer.Screen.Viewport))
 {
     rabbitImage = content.Load<Image>("Rabbit");
     deadRabbitImage = content.Load<Image>("DeadRabbit");
     malletHitSound = content.Load<Sound>("MalletHit");
     malletBloodImage = content.Load<Image>("BloodSplatter");
     this.renderer = renderer;
     this.score = score;
     this.time = time;
 }
Пример #3
0
 public UI(ItemHandler items, Score score, Content content, Renderer renderer, Window window,
     InputCommands inputCommands)
     : base(content.Load<Image>("GrassBackground"), renderer.Screen.Viewport)
 {
     window.ShowCursor = false;
     window.Title = "Game Of Death - Kill rabbits before they occupy more than 75% of the world!";
     inputCommands.Add(Key.Escape, window.Dispose);
     RenderLayer = MinRenderLayer;
     AddUITop(content, renderer);
     AddUIBottom(content, renderer);
     AddUILeft(content, renderer);
     AddUIRight(content, renderer);
     renderer.Screen.ViewportSizeChanged += () => Update(renderer);
 }
Пример #4
0
 public ItemHandler(Game game, Score score, Content content, InputCommands inputCommands,
     Renderer renderer)
 {
     this.game = game;
     this.score = score;
     this.renderer = renderer;
     CreateItems(content);
     CreateIcons(content);
     SelectItem(0);
     inputCommands.AddMouseMovement(mouse => CurrentItem.UpdatePosition(mouse.Position));
     inputCommands.Add(MouseButton.Left, State.Pressing,
         mouse => SelectIconOrHandleItemInGame(mouse.Position));
     inputCommands.Add(touch => SelectIconOrHandleItemInGame(touch.GetPosition(0)));
 }