mostani
This commit is contained in:
parent
fa2bbf5aba
commit
d1585aff52
|
@ -24,7 +24,7 @@ namespace Hanoitornyai
|
|||
}
|
||||
for (int i = 0;i < kszinek.Length;i++)
|
||||
{
|
||||
rudak[0].korongok.Add(new Korong(kszinek[i], i));
|
||||
rudak[0].korongok.Add(new Korong(kszinek[i], 5-i));
|
||||
}
|
||||
rudakPozicioSzamitas();
|
||||
|
||||
|
@ -54,7 +54,19 @@ namespace Hanoitornyai
|
|||
private void KorongSzamitas()
|
||||
{
|
||||
float km = rudak[0].szelesseg*1.5f;
|
||||
float ksz =
|
||||
float rsz = rudak[0].szelesseg;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
for (int j = 0; j < rudak[i].korongok.Count; j++)
|
||||
{
|
||||
rudak[i].korongok[j].magassag = km;
|
||||
int meret = rudak[i].korongok[j].meretjelzo;
|
||||
rudak[i].korongok[j].szelesseg = rsz + (rsz*meret);
|
||||
float rx = rudak[i].x;
|
||||
rudak[i].korongok[j].x = rx - ((rudak[i].korongok[j].szelesseg - rsz) / 2);
|
||||
rudak[i].korongok[j].y = JatekPanel.Height - ((j + 1) * km);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
public void Initialize()
|
||||
|
@ -77,9 +89,15 @@ namespace Hanoitornyai
|
|||
g.Clear(JatekPanel.BackColor);
|
||||
Brush brush = new SolidBrush(rudak[0].szin);
|
||||
rudakPozicioSzamitas();
|
||||
KorongSzamitas();
|
||||
for (int i = 0; i < rudak.Length; i++)
|
||||
{
|
||||
g.FillRectangle(brush, rudak[i].x, rudak[i].y, rudak[i].szelesseg, rudak[i].magassag);
|
||||
foreach(Korong k in rudak[i].korongok)
|
||||
{
|
||||
Brush korongecset = new SolidBrush(k.szin);
|
||||
g.FillRectangle(korongecset, k.x, k.y, k.szelesseg, k.magassag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user