Пример #1
0
 /// <summary>
 ///
 /// </summary>
 public void OnHovered()
 {
     if (Input.GetMouseButton(0))
     {
         GameMaker.UpdateClicked(x, y, BrushType.brushType);
     }
 }
Пример #2
0
 /// <summary>
 /// При нажатии на кнопку Apply обновляется поле и русуются новые ячейки с новым размером
 /// </summary>
 public void OnApplyClicked()
 {
     inst = this;
     DeleteField();
     SetSize();
     GenerateField();
     Preset();
     SetColors();
 }
Пример #3
0
 void Awake()
 {
     if (Instance == null) {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     } else if (Instance != this) {
         Destroy(gameObject);
     }
 }
Пример #4
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.Log("Multiple Gamemakers");
     }
     DontDestroyOnLoad(this.gameObject);
 }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();
            ScoreController.LoadScoreBoard();
            AudioPlayer.Load("on_dead", AppDomain.CurrentDomain.BaseDirectory + "Music/on_dead.wav", false);
            AudioPlayer.Load("background", AppDomain.CurrentDomain.BaseDirectory + "Music/temp_back.wav", true);
            AudioPlayer.Load("on_coin_collide", AppDomain.CurrentDomain.BaseDirectory + "Music/coin.wav", false);
            AudioPlayer.Load("enemy_getbackhere", AppDomain.CurrentDomain.BaseDirectory + "Music/enemy_getbackhere.wav", false);
            AudioPlayer.Load("sucktion", AppDomain.CurrentDomain.BaseDirectory + "Music/SUCTION.wav", false);
            AudioPlayer.Load("boom", AppDomain.CurrentDomain.BaseDirectory + "Music/boom.wav", false);

            AudioPlayer.Soundtrack.First(o => o.Key == "background").Value.player.Volume = 1.2;
            AudioPlayer.Play("background");
            gm = new GameMaker(this, 800, 600);
            gm.InitializeGame(PrepareMenus());
            Camera.OnFall           += Player_Fell;
            PhysicalObject.Collided += ObjectInteraction;
        }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("init of GenerateBoxes.cs");

        //GameplayConstants should be a init class, where I should put all numbers and use the instance
        gameMaker = new GameMaker(GameplayConstants.rowCount,
                                  GameplayConstants.rowWidth,
                                  GameplayConstants.groundFrom,
                                  GameplayConstants.groundTo,
                                  Player,
                                  new SimpleLevelGenerator(),
                                  new SimpleGameRules(),
                                  new InfiniteWorldCreator());

        GameplayConstants.SetGameOver(false);

        gameMaker.LoadTheLevel();

        gameMaker.InitializeTheWorld();

        world = gameMaker.GetCreatedWorldObjects();
    }
Пример #7
0
        private void AddResourceNodes( TreeNode aParent, GameMaker.Format.Resources.ResourceTreeNode aNode )
        {
            foreach ( var node in aNode ) {
            var child = aParent.Nodes.Add( node.Name );
            child.SelectedImageIndex = child.ImageIndex = (node.Type == GameMaker.Format.Resources.NodeTypes.Child ? 1 : 0);

            AddResourceNodes( child, node );
              }
        }
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 public void OnClicked()
 {
     GameMaker.UpdateClicked(x, y, BrushType.brushType);
 }
Пример #9
0
 // Use this for initialization
 void Awake()
 {
     S       = this;
     playing = false;
 }
Пример #10
0
        public MainPage()
        {
            Title = "Archery";

            Splash();

            Game = GameMaker.CreateGame(GameType.Default);
            //Game = GameMaker.CreateGame(GameType.Easy);

            // Main layout
            StackLayout layout = new StackLayout()
            {
                Orientation = StackOrientation.Vertical
            };

            // Top panel
            StackLayout scorePanel = new StackLayout()
            {
                Orientation       = StackOrientation.Horizontal,
                Padding           = new Thickness(10, 10, 10, 10),
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor   = Color.FromHex("#2F2F2F")
            };

            // Total score label
            scorePanel.Children.Add(new Label()
            {
                Text              = "SCORES:",
                FontSize          = 15,
                TextColor         = Color.WhiteSmoke,
                HorizontalOptions = LayoutOptions.Start
            });
            Label totalScoreLabel = new Label
            {
                BindingContext    = Game,
                FontSize          = 15,
                TextColor         = Color.GreenYellow,
                HorizontalOptions = LayoutOptions.StartAndExpand
            };

            totalScoreLabel.SetBinding(Label.TextProperty, "TotalScore");
            totalScoreLabel.PropertyChanging += OnLabelChanging;
            totalScoreLabel.PropertyChanged  += OnLabelChanged;
            scorePanel.Children.Add(totalScoreLabel);

            // Last arrow label
            scorePanel.Children.Add(new Label()
            {
                Text              = "LAST ARROW:",
                FontSize          = 15,
                TextColor         = Color.WhiteSmoke,
                HorizontalOptions = LayoutOptions.EndAndExpand
            });
            Label lastScoreLabel = new Label()
            {
                BindingContext    = Game,
                FontSize          = 15,
                TextColor         = Color.GreenYellow,
                HorizontalOptions = LayoutOptions.End
            };

            lastScoreLabel.SetBinding(Label.TextProperty, "LastScore", stringFormat: "+{0}");
            lastScoreLabel.PropertyChanging += OnLabelChanging;
            lastScoreLabel.PropertyChanged  += OnLabelChanged;
            scorePanel.Children.Add(lastScoreLabel);

            SKCanvasView canvasView = new SKCanvasView();

            // Render game
            Game.Draw(canvasView);
            layout.Children.Add(scorePanel);
            layout.Children.Add(canvasView);

            // New game button
            Button newGameButton = new Button()
            {
                Text     = "New Game",
                FontSize = 15,
            };

            newGameButton.Clicked += OnNewGameButtonClicked;

            layout.Children.Add(newGameButton);

            Content = layout;
        }
Пример #11
0
 public void init()
 {
     _gameMaker = new GameMaker();
 }