I received an error:
'MoveBall.Game' does not contain a definition for 'ballSpeedAxis1' and no extension method 'ballSpeedAxis1' accepting a first argument of type 'MoveBall.Game' could be found (are you missing a using directive or an assembly reference?)
In the beginning, there was no error when I tried to insert the value one by one.
int ballSpeedAxis1 = 1;
int ballSpeedAxis2 = 1;
...
int ballSpeedAxis10 = 1;
However, after I changed to a for loop as shown below.
var ballSpeedXAxis = new int[10];
for (int i = 0; i < ballSpeedXAxis.Length; i++)
{
ballSpeedXAxis[i] = 1;
}
The error occurs on the following lines:
private void OnUpdate(object sender, object e)
{
Canvas.SetLeft(this.ball1, this.ballSpeedXAxis + Canvas.GetLeft(this.ball1));
}
May I know how can I solved it?
Canvas.SetLeft(this.ball1, this.ballSpeedXAxis + Canvas.GetLeft(this.ball1));so it's hard to say why there is an error. Please show all of the relevant code.. Are you usingballSpeedAxis1` instead ofballSpeedXAxisaccidentally?