So basically I have a picturebox thats the players image. And I have a class that contains there X and Y values which looks like this:
Code: Select all
class PlayerXY
{
static private int x = 50;
static private int y = 50;
static public int X
{
get { return x; }
set { x = value; }
}
static public int Y
{
get { return y; }
set { y = value; }
}
}
Code: Select all
Player.Location = new Point(PlayerXY.X, PlayerXY.Y);
For example when the player pressed W It would call playerMovement.Up, which looks like
Code: Select all
static public void Up()
{
PlayerXY.Y += 50;
Player.Location = new Point(PlayerXY.X, PlayerXY.Y);
}
I'm pretty sure this is something with windows forms but idk.
Sorry if this is a huge post but I didn't want to under-inform you guys
Oh also this is for the RogueLike game that i'm making.
Thanks!