Var
AnaForm:TclForm;
btn1 : TClProButton;
Zaman : TCLTimer;
sayac:Integer;
oyunzaman:TCLTimer;
sayac1:Integer;
lblTimer: TCLLabel;
testImg: TCLImage; //random yerlerde belirli zamanda görsel çıkartıyor. //EKSURE İÇİN KULLANDIM.
void eksure
{
if(IntToStr(btn1.Text)==25)
{
testImg.Visible=True;
sayac1 = sayac1+5;
}
}
void zamanlayici;
{
sayac = sayac + 1;
oyunzaman.Enabled=True;
btn1.Text = IntToStr(sayac);
if(sayac == 25)
{
AnaForm.SetFormColor('#23c7c5','',clGNone);
sayac1 = sayac1 + 3;
btn1.Position.X = Abs((Random() * AnaForm.clWidth) - btn1.Width);
btn1.Position.Y = Abs((Random() * AnaForm.clHeight) - btn1.Height);
testImg.Position.X = Abs((Random() * AnaForm.clWidth) - testImg.Width);
testImg.Position.Y = Abs((Random() * AnaForm.clHeight) - testImg.Height);
}
if(sayac == 72)
{
AnaForm.SetFormColor('#e01f1f','',clGNone);
sayac1 = sayac1 + 5;
btn1.Position.X = Abs((Random() * AnaForm.clWidth) - btn1.Width);
btn1.Position.Y = Abs((Random() * AnaForm.clHeight) - btn1.Height);
}
if(sayac == 100)
{
AnaForm.SetFormColor('#cfeb00','#db7edd',clGHorizontal);
sayac1 = sayac1 + 7;
btn1.Position.X = Abs((Random() * AnaForm.clWidth) - btn1.Width);
btn1.Position.Y = Abs((Random() * AnaForm.clHeight) - btn1.Height);
}
}
void sure;
{
if(sayac1 == 0)
{
oyunzaman.Enabled = False;
lblTimer.caption = IntToStr(sayac1);
//sayac1=20; // GEREKLİ OLDUĞUNDA AÇILACAK.
ShowMessage('Süreniz Doldu!');
ShowMessage('Puanınız: ' + IntToStr(sayac));
}
else
{
lblTimer.caption=IntToStr(sayac1);
Dec(sayac1);
}
}
{
sayac=0;
sayac1=35;
AnaForm = TclForm.Create(Self);
oyunzaman=AnaForm.AddNewTimer(AnaForm,'oyunzaman',1000);
oyunzaman.Enabled=False;
AnaForm.AddNewEvent(oyunzaman,tbeOnTimer,'sure');
lblTimer=AnaForm.AddNewLabel(AnaForm,'lblTimer','');
lblTimer.StyledSettings = ssFamily;
lblTimer.TextSettings.Font.Size = 35;
lblTimer.Align = alTop;
lblTimer.Height=50;
lblTimer.Width=50;
lblTimer.Margins.Left = 170;
AnaForm.SetFormColor('#52504d','',clGNone);
btn1 = AnaForm.AddNewProButton(AnaForm,'btn1','SAYAC');
testImg = AnaForm.AddNewImage(AnaForm,'testImg');
btn1.Align = alNone; //Böyle yaparak butonu sabitlemiş oluyorum.
btn1.Width = 100;
btn1.Height = 100;
btn1.Position.X = (AnaForm.clWidth / 2) - (btn1.Width / 2); //konum1.
btn1.Position.Y = (AnaForm.clHeight / 2) - (btn1.Width / 2); // konum2.
AnaForm.SetImage(testImg,' https://cdn2.iconfinder.com/data/icons/chess-58/377/Time-256.png" rel="nofollow - https://cdn2.iconfinder.com/data/icons/chess-58/377/Time-256.png ');
testImg.Align = alNone;
testImg.Height = 30;
testImg.Width = 30;
testImg.Visible=False;
testImg.Position.X = (AnaForm.clWidth / 2) - (testImg.Width / 2); //testImg konum1.
testImg.Position.Y = (AnaForm.clHeight / 2) - (testImg.Width / 2); //testImg konum2.
btn1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#a0a3b1');
btn1.clProSettings.FontColor = clAlphaColor.clHexToColor('#050505');
btn1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#ffffff');
btn1.clProSettings.IsTransparent = False;
btn1.clProSettings.FontSize = 12;
btn1.clProSettings.FontVertAlign = palcenter;//palLeading , palCenter , palTrailing
btn1.clProSettings.FontHorzAlign = palCenter;
btn1.clProSettings.IsFill = True;
btn1.clProSettings.IsRound = True;
btn1.clProSettings.RoundHeight = 50;
btn1.clProSettings.RoundWidth = 50;
btn1.clProSettings.BorderWidth = 3;
btn1.SetclProSettings(btn1.clProSettings);
AnaForm.AddNewEvent(btn1,tbeOnClick,'zamanlayici');
AnaForm.AddNewEvent(testImg,tbeOnClick,'eksure');
AnaForm.Run;
}