Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Especie,Habilidad,Ocupacion,Ubicacion,Imagen")] Touhou touhou)
        {
            if (id != touhou.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(touhou);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TouhouExists(touhou.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(touhou));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Especie,Habilidad,Ocupacion,Ubicacion, Imagen")] Touhou touhou)
        {
            if (ModelState.IsValid)
            {
                _context.Add(touhou);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(touhou));
        }
Пример #3
0
        public Level(Touhou game)
        {
            this.game = game;

            // Load images and sprites
            spriteBatch = new SpriteBatch(game.GraphicsDevice);

            // Create the level player
            player = new Player(game, this);

            // Load other game media
            music = game.Content.Load<Song>("A Soul As Red As Ground Cherry");

            backgroundImage = game.Content.Load<Texture2D>("Sky");

            bulletTexture = game.Content.Load<Texture2D>("testbullet");

            // Start playing level music
            // MediaPlayer.Play(music);

            screenWidth = game.gameWidth;
            screenHeight = game.gameHeight;
        }