Inheritance: Listable
Exemple #1
0
    public void ContinueGame()
    {
        NewGame.loadSave();
        int[] loadedStats = SaveLoadManager.LoadPlayer();

        int currentLevel = loadedStats [0];

        switch (currentLevel)
        {
        case 0:
            SceneManager.LoadScene("Main");
            break;

        case 1:
            SceneManager.LoadScene("Level1");
            break;

        case 2:
            SceneManager.LoadScene("Level2");

            break;

        case 3:
            SceneManager.LoadScene("Level3");
            break;

        case 4:
            SceneManager.LoadScene("Level4");
            break;

        case 5:
            SceneManager.LoadScene("Level5");
            break;
        }
    }
Exemple #2
0
 public WGame(NewGame game)
 {
     InitializeComponent();
     Game             = game;
     Field            = new Field(canvas, game, tbWords, lInfo);
     btnCancel.Click += Field.BtnCancel_Click;
 }
Exemple #3
0
 static public void MoveRight(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.D)
     {
         NewGame.Right();
     }
 }
Exemple #4
0
    public int Cost(NewGame _game)
    {
        game = _game;
        int next = r.Next(game.notassigned.Count);

        return(game.notassigned[next]);
    }
        public async Task <IActionResult> NewGame()
        {
            var newGame = new NewGame();
            await newGame.LoadTimes(_config, _token);

            return(View(newGame));
        }
        public async Task <IActionResult> NewGame(NewGame NewGame)
        {
            Jogo jogo = new Jogo()
            {
                Data  = DateTime.Parse(NewGame.Data),
                Time1 = NewGame.Time1,
                Time2 = NewGame.Time2
            };

            using (var http = new HttpClient())
            {
                http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _token.Token);

                var response = await http.PostAsync(path + "/game", new StringContent(JsonConvert.SerializeObject(jogo), Encoding.UTF8, "application/json"));

                if (response.StatusCode == System.Net.HttpStatusCode.Created)
                {
                    return(RedirectToAction("Index"));
                }

                await NewGame.LoadTimes(_config, _token);

                ViewBag.MsgError = await response.Content.ReadAsStringAsync();

                return(View(NewGame));
            }
        }
Exemple #7
0
 static public void Rotate(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Space)
     {
         NewGame.Rotate();
     }
 }
Exemple #8
0
 public static void WriteTable(NewGame game)
 {
     Console.BackgroundColor = (ConsoleColor)MenuOptionsData.TableColor;
     for (int y1 = 0; y1 < game.Gamer.Table.GetLength(0); y1++)
     {
         for (int x1 = 0; x1 < game.Gamer.Table.GetLength(1); x1++)
         {
             Console.ForegroundColor = (ConsoleColor)MenuOptionsData.WordColor;
             if (x1 == x && y1 == y)
             {
                 Console.ForegroundColor = (ConsoleColor)MenuOptionsData.CursorColor;
             }
             else if (NewGame.CheckLetter(x1, y1, SelectedWord))
             {
                 Console.ForegroundColor = (ConsoleColor)MenuOptionsData.TrueWordColor;
             }
             else if (NewGame.CheckInWords(x1, y1, game))
             {
                 Console.ForegroundColor = (ConsoleColor)MenuOptionsData.TrueWordColor;
             }
             Console.Write(game.Gamer.Table[y1, x1]);
         }
         Console.WriteLine();
     }
     Console.ForegroundColor = ConsoleColor.White;
     for (int i = 0; i < GameTable.UsedWords.Count; i++)
     {
         Console.WriteLine(GameTable.UsedWords[i]);
     }
     Console.SetCursorPosition(20, 10);
     Console.Write($"Scores: {game.Gamer.Scores}");
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            /*
             * Context context = this;
             * createHeroes(context.Resources);
             */
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Game);

            NewGame       newGame = NewGame.CreateNewGame();
            EnumGameLevel level   = (EnumGameLevel)Intent.GetIntExtra("level", -1);

            newGame.setLevel(level);
            LinearLayout HeroPanel = FindViewById <LinearLayout>(Resource.Id.HeroPanel);

            for (int i = 0; i < HeroPanel.ChildCount; ++i)
            {
                LinearLayout dziecko = (LinearLayout)HeroPanel.GetChildAt(i);
                showHero.Add(new GUIHero(dziecko));
            }
            Context    context    = this;
            Controller controller = new Controller(newGame, this);

            controller.createHeroes(context.Resources);
            controller.createDicePool(context.Resources);
            Console.WriteLine("tu jestem!!!");
            controller.createThreat(context.Resources);
            // Create your application here
        }
Exemple #10
0
    void Awake()
    {
        Debug.Log("CURRENT LEVEL IS " + currentLevel);

        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        if (NewGame.newSave != true)
        {
            toastText = "Checkpoint added";
            setToastText();
        }

        if (NewGame.newSave == true)
        {
            currentLevel = 0;
            playerHealth = 100;
            rKey         = 0;
            sKey         = 0;
            foodCount    = 0;
            batteryCount = 0;
            playerHealth = 100;
            batteryLife  = 80f;
            Save();
            NewGame.loadSave();
        }

        //Get title up
    }
Exemple #11
0
        // [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]

        public async Task <IActionResult> PutNewGame(int id, NewGame newGame, string adminHash)
        {
            var admin = Environment.GetEnvironmentVariable("ADMIN_HASH");

            if (adminHash == admin)
            {
                if (id != newGame.Id)
                {
                    return(BadRequest());
                }

                _context.Entry(newGame).State = EntityState.Modified;

                try
                {
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NewGameExists(id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(NoContent());
        }
Exemple #12
0
        public MainWindow()
        {
            Pages = new ObservableCollection <WizardPage>();

            InitializeComponent();

            Pages.Add(new WelcomePage());
            Pages.Add(new BasicInfoPage());
            Pages.Add(new TableSidesPage());
            Pages.Add(new CreatePage());
            Pages.Add(new FinalPage());

            var newgame = new NewGame();

            newgame.Authors     = Environment.UserName;
            newgame.Name        = "Game";
            newgame.Url         = "https://www.octgn.net";
            newgame.Description = "A basic OCTGN game plugin.";

            foreach (var page in Pages)
            {
                page.Game        = newgame;
                page.DataContext = newgame;
            }

            Page = Pages[0];

            UpdateForwardBack();

            Pages.CollectionChanged += Pages_CollectionChanged;
        }
Exemple #13
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "ball")
     {
         audioSource.Play();
         scorePlayer += 1;
         Destroy(ball);
         (Instantiate(ballPref, new Vector3(padleObj.transform.position.x + 2, padleObj.transform.position.y, 0), Quaternion.identity) as GameObject).transform.parent = padleObj;
         if (scorePlayer == end)
         {
             if (NewGame.onePlayer)
             {
                 winner.transform.position = posOne;
                 winner.text = "Victory!";
                 NewGame.RequestBanner();
                 showAd();
             }
             else
             {
                 winner.transform.position = posTwo;
                 winner.text = "Player 1 wins!";
                 NewGame.RequestBanner();
                 showAd();
             }
         }
     }
 }
Exemple #14
0
    //============================================================
    // Public Methods:
    //============================================================

    public void StartGame()
    {
        isPlayingGame = true;

        // reset our asteroid split amount
        asteroidSplitAmount = DEFAULT_ASTEROID_SPLIT_AMOUNT;

        // reset our enemy spawn amount
        enemySpawnAmount = DEFAULT_ENEMY_SPAWN_AMOUNT;

        // reset our waves survived tracker
        wavesSurvived = 0;

        // reset the flags that determine the end of the wave
        allAsteroidsDestroyed = false;
        allEnemiesDestroyed   = false;

        // let others know that this is a new game so they too can reset
        if (NewGame != null)
        {
            NewGame.Invoke();
        }

        // spawn the first bunch of asteroids
        StartContinueGame();
    }
Exemple #15
0
        public GameId CreateGame(NewGame createGame)
        {
            if (createGame?.Players == null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
            if (createGame.Players.Count() != 2)
            {
                throw new NumberOfPlayersMustBeTwoException();
            }
            if (createGame.Players[0] == createGame.Players[1])
            {
                throw new PlayerNameException();
            }
            if (createGame.Players.Any(p => p == null || p == ""))
            {
                throw new PlayerNameException();
            }
            if (createGame.Rows < 4 || createGame.Columns < 4)
            {
                throw new RowsColumnsCannotBeLessThanFourException();
            }

            var game = new Game(createGame.Players[0], createGame.Players[1], createGame.Rows, createGame.Columns);

            _games.Add(game);
            return(new GameId {
                Id = game.Id
            });
        }
Exemple #16
0
 static public void MoveLeft(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.A)
     {
         NewGame.Left();
     }
 }
Exemple #17
0
        private Game SetupNewGameForTesting(int numberOfPeople, int numberOfComputers)
        {
            var game = StartUp.CreatePlayers();

            NewGame.SetupPlayers(numberOfPeople, numberOfComputers, ref game);
            return(game);
        }
Exemple #18
0
    public int minimax(NewGame _game)
    {
        game = _game;
        List <int> routes = new List <int>();

        routes.AddRange(game.notassigned);
        int maxPoints = -100000;
        int index     = -1;

        foreach (var v in routes)
        {
            int depth = 1;
            if (game.notassigned.Count < maxDepth)
            {
                depth = maxDepth + 1 - game.notassigned.Count;
            }

            game.notassigned.Remove(v);
            int column = v % size;
            int row    = v / size;
            game.playground[row][column] = true;
            int pts = game.getPoints(v);
            game.notassigned.Add(v);
            game.playground[row][column] = false;
            int tempPoints = Minmax(v, true, depth, 0);
            if (tempPoints > maxPoints)
            {
                maxPoints = tempPoints;
                index     = v;
            }
        }
        return(index);
    }
Exemple #19
0
 public NewRandom(int _size)
 {
     size = _size;
     game = new NewGame();
     game.Init(_size);
     r = new Random();
 }
Exemple #20
0
 public void WriteToROM()
 {
     if (NewGame != null && NewGame.Visible)
     {
         NewGame.WriteToROM();
     }
     if (Animations != null && Animations.Visible)
     {
         Animations.WriteToROM();
     }
     if (Attacks != null && Attacks.Visible)
     {
         Attacks.WriteToROM();
     }
     if (Battlefields != null && Battlefields.Visible)
     {
         Battlefields.WriteToROM();
     }
     if (Dialogues != null && Dialogues.Visible)
     {
         Dialogues.WriteToROM();
     }
     if (EventScripts != null && EventScripts.Visible)
     {
         EventScripts.WriteToROM();
     }
     if (Fonts != null && Fonts.Visible)
     {
         Fonts.WriteToROM();
     }
     if (Formations != null && Formations.Visible)
     {
         Formations.WriteToROM();
     }
     if (Items != null && Items.Visible)
     {
         Items.WriteToROM();
     }
     if (Areas != null && Areas.Visible)
     {
         Areas.WriteToROM();
     }
     if (Monsters != null && Monsters.Visible)
     {
         Monsters.WriteToROM();
     }
     if (Sprites != null && Sprites.Visible)
     {
         Sprites.WriteToROM();
     }
     if (Intro != null && Intro.Visible)
     {
         Intro.WriteToROM();
     }
     if (WorldMaps != null && WorldMaps.Visible)
     {
         WorldMaps.WriteToROM();
     }
 }
Exemple #21
0
 void Start()
 {
     shoot       = GetComponent <Shoot> ();
     helper      = GetComponent <Helper> ();
     game        = GetComponent <NewGame> ();
     bubblesLeft = game.totalUsableBubbles;
     playing     = true;
 }
Exemple #22
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            this.axWindowsMediaPlayerSfx.URL = Environment.CurrentDirectory + @"\sfx\MouseClick.wav";
            NewGame ng = new NewGame();

            this.Hide();
            ng.Show();
        }
Exemple #23
0
 public NewMinMax(int _size, AlgorithmType _type, int _maxDepth, Heuristic _heur)
 {
     game     = new NewGame();
     r        = new Random();
     size     = _size;
     type     = _type;
     maxDepth = _maxDepth;
     heur     = _heur;
 }
    protected void NewGame()
    {
        HideCurrentMenu();
        NewGame newGame = GetComponent <NewGame>();

        if (newGame)
        {
            newGame.enabled = true;
        }
    }
Exemple #25
0
    void Start()
    {
        shoot       = GetComponent <Shoot> ();
        helper      = GetComponent <Helper> ();
        game        = GetComponent <NewGame> ();
        bubblesLeft = game.totalUsableBubbles;
        playing     = true;

        GuideLine = FindObjectOfType <LineRenderer> ().gameObject;
    }
 private void NewGame(object sender, RoutedEventArgs e)
 {
     if (N.IsVisible)
     {
     }
     else
     {
         N = new NewGame(); N.Show();
     }
 }
Exemple #27
0
 public Field(Canvas canvas, NewGame game, TextBlock tbWords, Label info)
 {
     this.Canvas = canvas;
     this.Game   = game;
     CreateField(game, canvas);
     AddLabelHandlers();
     this.Info = info;
     WriteWords(tbWords);
     SetLNameContent();
 }
        public async Task <IActionResult> NieuwSpel([FromBody] NewGame data)
        {
            var spel = new Game();

            spel.Player1Token = data.PlayerToken;
            spel.Description  = data.Description;
            spel.Token        = Guid.NewGuid().ToString();
            await repository.AddSpel(spel);

            return(Ok());
        }
Exemple #29
0
 static void Main(string[] args)
 {
     try
     {
         INewGame newGame = new NewGame();
         newGame.SetupNewGame();
     }catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
        public ActionResult addNewGame()
        {
            NewGame form = new NewGame();

            form.AlleConsoles = service.GetAllConsoles();
            if (TempData["duplicaat"] != null)
            {
                ViewBag.errorMessage = TempData["duplicaat"].ToString();
            }
            return(View(form));
        }
Exemple #31
0
        public static NewGame GetNewGame(string json_string)
        {
            NewGame temp = new NewGame();
            try {
                //string json_string = File.ReadAllText(SAPPRemote.MainWindow.SettingPath);
                if (Json.IsValid(json_string)) {
                    var s = new JsonSerializerSettings();
                    s.NullValueHandling = NullValueHandling.Ignore;
                    s.ObjectCreationHandling = ObjectCreationHandling.Replace; // without this, you end up with duplicates.

                    temp = JsonConvert.DeserializeObject<NewGame>(json_string, s);
                } else {

                }
            } catch (Exception) {
            }
            return temp;
        }
 public void NewGame_Click(object sender, RoutedEventArgs e)
 {
     NewGame newGameWindow = new NewGame();
     newGameWindow.parent = this;
     newGameWindow.Owner = this;
     newGameWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
     newGameWindow.Show();
 }