I’m using visual studio community 2022 or it might be something from my code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace flappy_bird
{
public class Game1 : Game
{
private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch;
private Texture2D player;
private Vector2 pMov;
private int height;
private int width;
public Game1()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = true;
}
protected override void Initialize()
{
// TODO: Add your initialization logic here
_graphics.PreferredBackBufferHeight = 480;
_graphics.PreferredBackBufferWidth = 480;
_graphics.ApplyChanges();
height = _graphics.PreferredBackBufferHeight;
width = _graphics.PreferredBackBufferWidth;
base.Initialize();
}
protected override void LoadContent()
{
_spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
Content.Load<Texture2D>("player");
pMov = new Vector2(height/2, width/2);
}
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit();
// TODO: Add your update logic here
for (int yv = 1; yv > 0; yv++)
{
pMov.Y -= yv;
}
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
_spriteBatch.Begin();
_spriteBatch.Draw(player, pMov, Color.White);
_spriteBatch.End();
base.Draw(gameTime);
}
}
}
whenever i try to debug my game the window will just not respond eternally.