Szybkie pytanko. Dlaczego to nie działa? Nie wiem czy dobrze rozumiem. Pisze że to nie jest zmienna? Ale to jest przecie zmienna! Tak?
Nie ogarniam proszę niech ktoś mi to wytłumaczy. (Luknijcie na załącznik)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//using System.Drawing;
namespace Kucykowe_Igrzyska
{
class Greyhound
{
// PictureBox[] kucyki = new PictureBox[4];
//PictureBox[]kucyki = { rainbow
//Kucyki[] kucyki = new Kucyki[4];
// public PictureBox[] kucyk; //= new PictureBox[4];
public PictureBox red;
public bool Zapieprzaj = true;
public int sprawdzam = 1;
public Timer clock;
public Random Randomizer;
int[] losuj = { 10, 20, 30, 40 };
public void TakeStartingPosition()
{
// MessageBox.Show(""+red.Location.X);
if (red.Location.X != 15)
{
red.Location.X = 15;
// red.Location = new Point(15,red.Location.Y) ;
}
//red.Location.X = sprawdzam;
}
public void Move()
{
// Randomizer = new Random();
if (red != null)
{
if (Zapieprzaj == true)
{
red.Left += losuj[Randomizer.Next(losuj.Length)];
if (red.Left >= red.Parent.Width - red.Width)
{
Zapieprzaj = false;
MessageBox.Show(red.Name);
}
}
else
{
clock.Enabled = false;
// clock.Enabled = false;
/* red.Left -= 10;
if (red.Left <= 0)
{
Zapieprzaj = true;
}*/
}
}
/* public int StartingPosition;
public int RacetrackLength;
public PictureBox myPictureBox = null;
public int Location = 0;
public Random MyRandom;
public bool Run()
{
}
public void TakeStartingPosition()
{
} */
}
}
}