C# No overload for method 'loop' takes 0 arguments
Posted: Sun Jan 22, 2012 9:09 pm
So I was working on a little RPG game in windows forms. And it is giving me this error
"Error 1 No overload for method 'loop' takes 0 arguments"
So basically I have a picturebox that I want to move around the screen when the user presses W A S and D, I have a loop method that is constantly checking for movement. the loop method looks like this
And That loop doesn't start untill a button is clicked, which looks like this:
My error report tells me that the error is on the gameloop.loop(); line of code. and again the error says
"
No overload for method 'loop' takes 0 arguments
"
Thanks in advanced, Matt
BTW this is in Visual C#
"Error 1 No overload for method 'loop' takes 0 arguments"
So basically I have a picturebox that I want to move around the screen when the user presses W A S and D, I have a loop method that is constantly checking for movement. the loop method looks like this
Code: Select all
static public void loop(object sender, System.Windows.Forms.KeyEventArgs k)
{
do
{
if (k.KeyCode == Keys.W)
{
HeroMovement.Y = HeroMovement.Y + 50;
}
else if (k.KeyCode == Keys.S)
{
HeroMovement.Y = HeroMovement.Y - 50;
}
if (k.KeyCode == Keys.A)
{
HeroMovement.X = HeroMovement.X - 50;
}
else if (k.KeyCode == Keys.D)
{
HeroMovement.X = HeroMovement.X + 50;
}
}
while (k.KeyCode != Keys.Escape);
}
Code: Select all
private void Begin_Click(object sender, EventArgs e)
{
gameloop.loop();
}
"
No overload for method 'loop' takes 0 arguments
"
Thanks in advanced, Matt
BTW this is in Visual C#