So I'm rather a newbie when it comes to programming especially in c# i have an error i need help with?
So I'm trying to create a rpg system i started out before all else with the battle system which i just barely began my code which is store in Form1.cs is such
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public class Variables{
public Graphics character;
private void Form1_Load(object sender, EventArgs e){
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Up:
Player.Top = Player.Top - 5;
Battle.Steps = Battle.Steps + 10;
break;
case Keys.Down:
Player.Top = Player.Top + 5;
Battle.Steps = Battle.Steps + 10;
break;
case Keys.Left:
Player.Left = Player.Left - 5;
Battle.Steps = Battle.Steps + 10;
break;
case Keys.Right:
Player.Left = Player.Left + 5;
Battle.Steps = Battle.Steps + 10;
break;
}
if (Battle.Steps == 100)
{
Battle.Fight = true;
}
}
}
}
and Battle.cs is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication1
{
public class Battle
{
public static bool Fight {get; set;}
public static int Steps;
public void Fight (){
if (Fight == true)
{
}
}
}
}
However I'm getting an error Error Ambiguity between 'WindowsFormsApplication1.Battle.Fight' and 'WindowsFormsApplication1.Battle.Fight()'
when i try to access the variable in form 1 and also when i try to edit in in Battle.cs
What's going on how do i fix this or is there a better way to do this?