Sayfayı Yazdır | Pencereyi Kapat

oyunuma ses efekti ekleme

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Form Oluşturma
Forum Adı: TclForm Oluşturma
Forum Tanımlaması: Standart bir form oluşturma
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1471
Tarih: 05 Mayıs 2026 Saat 00:00
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: oyunuma ses efekti ekleme
Mesajı Yazan: MustafaYGD
Konu: oyunuma ses efekti ekleme
Mesaj Tarihi: 04 Mayıs 2026 Saat 20:19
ses efektlerim github yöntemiyle eklenemiyor
// DEPREM EGITIMI OYUNLARI - HIKAYE MODU

var
  Form1: TclForm;

  // ===== SES EFEKTLERI =====
  SndZipla, SndDusme, SndDeprem, SndParkurFon, SndClick, SndCanta: TclMediaPlayer;
  
  // ===== MENU =====
  pnlMenu: TclProPanel;
  lblMenuBaslik: TclLabel;
  btnOyunaBasla, btnMenuCikis: TclProButton;
  
  // ===== HIKAYE SAHNELERI =====
  pnlSahne1, pnlSahne2, pnlSahne3, pnlSahne4: TclProPanel;
  imgSahne1, imgSahne2, imgSahne3, imgSahne4: TclImage;
  btnDevam1, btnDevam2, btnDevam3, btnDevam4: TclProButton;

  // ===== DEPREM ANI OYUNU - ORIJINAL deprem_oyunu.tro =====
  GameContainer: TclProPanel;
  PnlRoom: TclProPanel;
  PnlTopBar, PnlTimeBar: TclProPanel;
  LblInstruction: TclProLabel;
  BtnStart, BtnRestart, BtnDepremContinue: TclProButton;
  ImgTable, ImgWindow, ImgShelf, ImgChandelier: TclProImage;
  ShakeTimer, GameTimer: TclTimer;
  TimeLeft: Integer;
  MaxTime: Integer;
  IsGameActive: Boolean;
  
  // ===== PARKUR OYUNU =====
  pnlParkur: TclProPanel;
  pnlParkurKontrol, pnlParkurUst: TclPanel;
  imgParkurArka: TclImage;
  imgKarakter: TclImage;
  karakterCember: TclCircle;
  animIdle, animWalk, animRun, animJump: TclBitmapListAnimation;
  tmrParkur, tmrMoloz, tmrParkurSure: TClTimer;
  pltf1, pltf2, pltf3, pltf4, pltf5: TclImage;
  pltf6, pltf7, pltf8, pltf9, pltf10: TclImage;
  pltf11, pltf12, pltf13, pltf14: TclImage;
  pltfBitis: TclImage;
  checkpoint1, checkpoint2, checkpoint3: TclImage;
  moloz1, moloz2, moloz3: TclPanel;
  btnParkurSol, btnParkurSag, btnParkurZipla: TclButton;
  btnParkurMenu: TclButton;
  lblParkurBaslik, lblParkurCan, lblParkurSure: TclLabel;
  karakterHiz, velocityY, yerCekimi: Integer;
  solGidiyor, sagGidiyor, havada: Boolean;
  idleAktif, walkAktif, runAktif, jumpAktif: Boolean;
  parkurCan, parkurSure, sonCheckpoint, parkurBolum: Integer;
  checkpointX, checkpointY: Integer;
  
  // ===== CANTA OYUNU =====
  pnlCanta: TclProPanel;
  pnlCantaUst, pnlCantaAlan, pnlCantaAlt: TclPanel;
  lblCantaBaslik, lblCantaSure, lblCantaPuan, lblCantaAciklama: TclLabel;
  btnCantaMenu: TclButton;
  pnlTorba: TclProPanel;
  lblTorba, lblCantaIcerik: TclLabel; 
  pnlSu, pnlIlkYardim, pnlFener, pnlIlac: TclProPanel;
  pnlDuduk, pnlBattaniye, pnlRadyo, pnlPara: TclProPanel;
  pnlTelefon, pnlKonsol, pnlPerfum, pnlLaptop: TclProPanel;
  lblSu, lblIlkYardim, lblFener, lblIlac: TclLabel;
  lblDuduk, lblBattaniye, lblRadyo, lblPara: TclLabel;
  lblTelefon, lblKonsol, lblPerfum, lblLaptop: TclLabel;
  pnlBilgi: TclProPanel;
  lblBilgiBaslik, lblBilgiIcerik: TclLabel;
  btnBilgiKapat: TclProButton;
  tmrCanta: TClTimer;
  cantaSure, cantaPuan, cantaKoyulan: Integer;
  cantaIcerigi: String;


// ========== SES FONKSIYONLARI ==========

void SesZiplaCal;
{
  SndZipla.CurrentTime = 0;
  SndZipla.Play;
}

void SesDogruCal;
{
  // Kullanilmiyor.
}

void SesYanlisCal;
{
  // Kullanilmiyor.
}

void SesDusmeCal;
{
  SndDusme.CurrentTime = 0;
  SndDusme.Play;
}

void SesFinalCal;
{
  // Kullanilmiyor.
}

void SesDepremBaslat;
{
  SndDeprem.CurrentTime = 0;
  SndDeprem.Play;
}

void SesDepremDurdur;
{
  SndDeprem.Stop;
}


void SesParkurFonBaslat;
{
  SndParkurFon.CurrentTime = 0;
  SndParkurFon.Play;
}

void SesParkurFonDurdur;
{
  SndParkurFon.Stop;
}

void SesClickCal;
{
  SndClick.CurrentTime = 0;
  SndClick.Play;
}

void SesCantaCal;
{
  SndCanta.CurrentTime = 0;
  SndCanta.Play;
}

// ========== ANIMASYON FONKSIYONLARI ==========

void IdleBaslat;
{
  if(idleAktif == False)
  {
    animIdle.Start; animWalk.Stop; animRun.Stop; animJump.Stop;
    idleAktif = True; walkAktif = False; runAktif = False; jumpAktif = False;
  }
}

void RunBaslat;
{
  if(runAktif == False)
  {
    animIdle.Stop; animWalk.Stop; animRun.Start; animJump.Stop;
    idleAktif = False; walkAktif = False; runAktif = True; jumpAktif = False;
  }
}

void JumpBaslat;
{
  if(jumpAktif == False)
  {
    animIdle.Stop; animWalk.Stop; animRun.Stop; animJump.Start;
    idleAktif = False; walkAktif = False; runAktif = False; jumpAktif = True;
  }
}

// ========== MENU FONKSIYONLARI ==========

void MenuGoster;
{
  SesDepremDurdur;
  SesParkurFonDurdur;
  pnlMenu.Visible = True; 
  pnlSahne1.Visible = False; pnlSahne2.Visible = False; 
  pnlSahne3.Visible = False; pnlSahne4.Visible = False;
  pnlParkur.Visible = False; pnlCanta.Visible = False; GameContainer.Visible = False;
  tmrParkur.Enabled = False; tmrMoloz.Enabled = False; tmrParkurSure.Enabled = False; tmrCanta.Enabled = False; ShakeTimer.Enabled = False; GameTimer.Enabled = False;
}


void ParkurBolum1Kur;
{
  parkurBolum = 1;
  lblParkurBaslik.Text = 'PARKUR 1/2 - TIRMANIS';

  pltf1.Position.X = 20;   pltf1.Position.Y = 415; pltf1.Width = 150; pltf1.Height = 20; pltf1.Visible = True;
  pltf2.Position.X = 215;  pltf2.Position.Y = 380; pltf2.Width = 115; pltf2.Height = 20; pltf2.Visible = True;
  pltf3.Position.X = 45;   pltf3.Position.Y = 340; pltf3.Width = 95;  pltf3.Height = 20; pltf3.Visible = True;

  checkpoint1.Position.X = 220; checkpoint1.Position.Y = 300; checkpoint1.Width = 120; checkpoint1.Height = 20; checkpoint1.Visible = True;

  pltf4.Position.X = 105;  pltf4.Position.Y = 260; pltf4.Width = 80;  pltf4.Height = 20; pltf4.Visible = True;
  pltf5.Position.X = 245;  pltf5.Position.Y = 220; pltf5.Width = 80;  pltf5.Height = 20; pltf5.Visible = True;
  pltf6.Position.X = 75;   pltf6.Position.Y = 180; pltf6.Width = 75;  pltf6.Height = 20; pltf6.Visible = True;
  pltf7.Position.X = 215;  pltf7.Position.Y = 140; pltf7.Width = 85;  pltf7.Height = 20; pltf7.Visible = True;

  checkpoint2.Position.X = 65; checkpoint2.Position.Y = 100; checkpoint2.Width = 135; checkpoint2.Height = 20; checkpoint2.Visible = True;

  pltf8.Visible = False; pltf9.Visible = False; pltf10.Visible = False; pltf11.Visible = False; pltf12.Visible = False;
  checkpoint3.Visible = False; pltf13.Visible = False; pltf14.Visible = False; pltfBitis.Visible = False;

  pltf8.Position.X = -800;  pltf8.Position.Y = -800;
  pltf9.Position.X = -800;  pltf9.Position.Y = -800;
  pltf10.Position.X = -800; pltf10.Position.Y = -800;
  pltf11.Position.X = -800; pltf11.Position.Y = -800;
  pltf12.Position.X = -800; pltf12.Position.Y = -800;
  checkpoint3.Position.X = -800; checkpoint3.Position.Y = -800;
  pltf13.Position.X = -800; pltf13.Position.Y = -800;
  pltf14.Position.X = -800; pltf14.Position.Y = -800;
  pltfBitis.Position.X = -800; pltfBitis.Position.Y = -800;

  karakterCember.Width = 52;
  karakterCember.Height = 70;
  imgKarakter.Width = 52;
  imgKarakter.Height = 70;

  karakterCember.Position.X = 45;
  karakterCember.Position.Y = pltf1.Position.Y - karakterCember.Height;
  imgKarakter.Position.X = karakterCember.Position.X;
  imgKarakter.Position.Y = karakterCember.Position.Y;

  checkpointX = karakterCember.Position.X;
  checkpointY = karakterCember.Position.Y;

  velocityY = 0;
  havada = False;
  solGidiyor = False;
  sagGidiyor = False;
}

void ParkurBolum2Kur;
{
  parkurBolum = 2;
  lblParkurBaslik.Text = 'PARKUR 2/2 - ENKAZ ROTASI';

  pltf1.Position.X = 210;  pltf1.Position.Y = 415; pltf1.Width = 145; pltf1.Height = 20; pltf1.Visible = True;
  pltf2.Position.X = 55;   pltf2.Position.Y = 375; pltf2.Width = 95;  pltf2.Height = 20; pltf2.Visible = True;
  pltf3.Position.X = 220;  pltf3.Position.Y = 335; pltf3.Width = 80;  pltf3.Height = 20; pltf3.Visible = True;

  checkpoint1.Position.X = 80; checkpoint1.Position.Y = 295; checkpoint1.Width = 105; checkpoint1.Height = 20; checkpoint1.Visible = True;

  pltf4.Position.X = 250;  pltf4.Position.Y = 255; pltf4.Width = 75;  pltf4.Height = 20; pltf4.Visible = True;
  pltf5.Position.X = 130;  pltf5.Position.Y = 215; pltf5.Width = 75;  pltf5.Height = 20; pltf5.Visible = True;
  pltf6.Position.X = 25;   pltf6.Position.Y = 175; pltf6.Width = 80;  pltf6.Height = 20; pltf6.Visible = True;
  pltf7.Position.X = 175;  pltf7.Position.Y = 135; pltf7.Width = 75;  pltf7.Height = 20; pltf7.Visible = True;

  checkpoint2.Position.X = 285; checkpoint2.Position.Y = 100; checkpoint2.Width = 80; checkpoint2.Height = 20; checkpoint2.Visible = True;

  pltf8.Position.X = 140;  pltf8.Position.Y = 135; pltf8.Width = 75;  pltf8.Height = 20; pltf8.Visible = True;
  pltf9.Position.X = 25;   pltf9.Position.Y = 175; pltf9.Width = 80;  pltf9.Height = 20; pltf9.Visible = True;
  pltf10.Position.X = 145; pltf10.Position.Y = 215; pltf10.Width = 80; pltf10.Height = 20; pltf10.Visible = True;
  pltf11.Position.X = 270; pltf11.Position.Y = 255; pltf11.Width = 75; pltf11.Height = 20; pltf11.Visible = True;

  checkpoint3.Position.X = 130; checkpoint3.Position.Y = 295; checkpoint3.Width = 95; checkpoint3.Height = 20; checkpoint3.Visible = True;

  pltf12.Position.X = 35;  pltf12.Position.Y = 335; pltf12.Width = 80; pltf12.Height = 20; pltf12.Visible = True;
  pltf13.Position.X = 160; pltf13.Position.Y = 375; pltf13.Width = 80; pltf13.Height = 20; pltf13.Visible = True;
  pltf14.Position.X = 270; pltf14.Position.Y = 415; pltf14.Width = 75; pltf14.Height = 20; pltf14.Visible = True;

  pltfBitis.Position.X = 110; pltfBitis.Position.Y = 410; pltfBitis.Width = 115; pltfBitis.Height = 20; pltfBitis.Visible = True;

  karakterCember.Width = 52;
  karakterCember.Height = 70;
  imgKarakter.Width = 52;
  imgKarakter.Height = 70;

  karakterCember.Position.X = 250;
  karakterCember.Position.Y = pltf1.Position.Y - karakterCember.Height;
  imgKarakter.Position.X = karakterCember.Position.X;
  imgKarakter.Position.Y = karakterCember.Position.Y;

  checkpointX = karakterCember.Position.X;
  checkpointY = karakterCember.Position.Y;

  velocityY = 0;
  havada = False;
  solGidiyor = False;
  sagGidiyor = False;
}

void ParkurBolumGec;
{
  tmrParkur.Enabled = False;
  velocityY = 0;
  havada = False;
  solGidiyor = False;
  sagGidiyor = False;
  ShowMessage('Bolum 1 tamam! Bolum 2 basliyor.');
  ParkurBolum2Kur;
  IdleBaslat;
  tmrParkur.Enabled = True;
}

void ParkurAc;
{
  pnlMenu.Visible = False;
  pnlParkur.Visible = True;
  pnlCanta.Visible = False;
  pnlSahne1.Visible = False;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = False;
  pnlSahne4.Visible = False;

  karakterHiz = 8;
  velocityY = 0;
  yerCekimi = 2;
  solGidiyor = False;
  sagGidiyor = False;
  havada = False;

  parkurCan = 3;
  parkurSure = 90;
  sonCheckpoint = 0;
  parkurBolum = 1;

  lblParkurCan.Text = '❤️ ❤️ ❤️';
  lblParkurSure.Text = 'Sure: 90s';

  moloz1.Position.Y = -1000;
  moloz2.Position.Y = -1000;
  moloz3.Position.Y = -1000;

  idleAktif = False;
  walkAktif = False;
  runAktif = False;
  jumpAktif = False;

  ParkurBolum1Kur;
  IdleBaslat;


  SesParkurFonBaslat;

  tmrParkur.Enabled = True;
  tmrParkurSure.Enabled = True;
  tmrMoloz.Enabled = False;
}

void CantaAc;
{
  pnlMenu.Visible = False; pnlParkur.Visible = False; pnlCanta.Visible = True; GameContainer.Visible = False;
  pnlSahne1.Visible = False; pnlSahne2.Visible = False; 
  pnlSahne3.Visible = False; pnlSahne4.Visible = False;
  
  cantaSure = 90; cantaPuan = 0; cantaKoyulan = 0;
  cantaIcerigi = ''; 
  lblCantaIcerik.Text = ''; 
  
  pnlSu.Visible = True; pnlIlkYardim.Visible = True; pnlFener.Visible = True; pnlIlac.Visible = True;
  pnlDuduk.Visible = True; pnlBattaniye.Visible = True; pnlRadyo.Visible = True; pnlPara.Visible = True;
  pnlTelefon.Visible = True; pnlKonsol.Visible = True; pnlPerfum.Visible = True; pnlLaptop.Visible = True;
  pnlBilgi.Visible = False;
  
  lblCantaPuan.Text = 'Puan: 0'; lblCantaSure.Text = 'Sure: 90s';
  tmrCanta.Enabled = True;
}

void MenuCikis;
{
  Form1.Close;
}


// ========== DEPREM ANI OYUNU - ORIJINAL deprem_oyunu.tro ENTEGRASYONU ==========

// --- SARSINTI EFEKTİ (HEARTBEAT) ---
// Bu fonksiyon her 50 milisaniyede bir çalışıp odayı sağa sola sallar
void ShakeRoom;
var 
  RndX, RndY: Integer;
{
  if IsGameActive
  {
    // Rastgele sarsıntı koordinatları üret (0 ile 15 piksel arası)
    RndX = clMath.GenerateRandom(0, 15);
    RndY = clMath.GenerateRandom(0, 15);

    // Odanın kenar boşluklarını değiştirerek titreme efekti yarat
    PnlRoom.Margins.Left = RndX;
    PnlRoom.Margins.Top = RndY;
    PnlRoom.Margins.Right = 15 - RndX; // Tersi yöne it
    PnlRoom.Margins.Bottom = 15 - RndY;

    PnlRoom.SetclProSettings(PnlRoom.clProSettings);
  }
}

// --- OYUN BİTİŞ EKRANI ---
void EndGame(Success: Boolean; Msg: String);
{
  SesDepremDurdur;
  IsGameActive = False;
  ShakeTimer.Enabled = False;
  GameTimer.Enabled = False;

  // Odayı düzelt
  PnlRoom.Margins.Left = 5; PnlRoom.Margins.Top = 5;
  PnlRoom.Margins.Right = 5; PnlRoom.Margins.Bottom = 5;
  PnlRoom.SetclProSettings(PnlRoom.clProSettings);

  if Success
  {
      ShowMessage('🏆 TEBRİKLER!\n' + Msg);
    PnlRoom.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#C6F6D5'); // Yeşil Zemin
    BtnDepremContinue.Visible = True;
    BtnRestart.Visible = False;
  }
  else
  {
      ShowMessage('💀 OYUN BİTTİ!\n' + Msg);
    PnlRoom.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FEB2B2'); // Kırmızı Zemin
    BtnRestart.Visible = True;
    BtnDepremContinue.Visible = False;
  }
  PnlRoom.SetclProSettings(PnlRoom.clProSettings);

  BtnStart.Visible = False;
}

// --- NESNEYE TIKLAMA ---
void ObjectClick;
var ClickedObj: TclProImage;
{
  if IsGameActive == False Exit;

  ClickedObj = TclProImage(Form1.ClSender);

  // ID 1: Masa (Güvenli)
  // ID 2: Pencere (Riskli)
  // ID 3: Dolap (Riskli)
  // ID 4: Avize (Riskli)

  if ClickedObj.clTagInt == 1 
  {
    EndGame(True, 'Mükemmel! Hayat üçgeni oluşturdun ve güvendesin.');
  }
  else
  {
    // Yanlış tıklama hemen oyunu bitirmesin, sarsıntıyı artırabilir veya bitirebilir.
    // Biz zorluk olsun diye bitirelim.
    if ClickedObj.clTagInt == 2 EndGame(False, 'Pencere patladı! Asla cam kenarında durma.');
    if ClickedObj.clTagInt == 3 EndGame(False, 'Dolap üzerine devrildi! Eşyalardan uzak dur.');
    if ClickedObj.clTagInt == 4 EndGame(False, 'Avize düştü! Tavan altı tehlikelidir.');
  }
}

// --- SÜRE YÖNETİMİ ---
void OnTimeTick;
var Ratio: Double;
{
  TimeLeft = TimeLeft - 1;
// Süre çubuğunu küçült (Görsel Efekt)
  Ratio = TimeLeft / MaxTime;
  PnlTimeBar.Width = (Form1.clWidth - 40) * Ratio;

  // Renk değişimi (Yeşilden Kırmızıya)
  if TimeLeft < 40 
    PnlTimeBar.clProSettings.BackgroundColor = clAlphaColor.clRed;
  else
    PnlTimeBar.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#48BB78');

  PnlTimeBar.SetclProSettings(PnlTimeBar.clProSettings);

  if TimeLeft <= 0
  {
    EndGame(False, 'Süre doldu! Panik yaptın ve hareket edemedin.');
  }
}

// --- OYUNU BAŞLAT ---
void StartGame;
{
  SesClickCal;
  SesDepremBaslat;

  IsGameActive = True;
  MaxTime = 100; // 10 saniye (Timer 100ms çalışacak)
  TimeLeft = MaxTime;

  // Odayı sıfırla
  PnlRoom.clProSettings.BackgroundColor = clAlphaColor.clWhite;
  PnlRoom.SetclProSettings(PnlRoom.clProSettings);

  BtnStart.Visible = False;
  BtnRestart.Visible = False;
  BtnDepremContinue.Visible = False;
  LblInstruction.Text = 'SARSINTI BAŞLADI! GÜVENLİ YERİ BUL!';
  LblInstruction.clProSettings.FontColor = clAlphaColor.clRed;
  LblInstruction.SetclProSettings(LblInstruction.clProSettings);

  // Timerları Başlat
  ShakeTimer.Enabled = True; // Sarsıntı efekti için (Hızlı)
  GameTimer.Enabled = True;  // Süre için (Orta)
}

// Ana oyundaki Deprem Anı ara sahnesinden sonra bu panel açılır.
void DepremOyunuAc;
{
  pnlMenu.Visible = False;
  pnlSahne1.Visible = False;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = False;
  pnlSahne4.Visible = False;
  pnlCanta.Visible = False;
  pnlParkur.Visible = False;
  GameContainer.Visible = True;

  IsGameActive = False;
  ShakeTimer.Enabled = False;
  GameTimer.Enabled = False;

  MaxTime = 100;
  TimeLeft = MaxTime;

  PnlRoom.Margins.Left = 5; PnlRoom.Margins.Top = 5;
  PnlRoom.Margins.Right = 5; PnlRoom.Margins.Bottom = 5;
  PnlRoom.clProSettings.BackgroundColor = clAlphaColor.clWhite;
  PnlRoom.SetclProSettings(PnlRoom.clProSettings);

  PnlTimeBar.Width = Form1.clWidth - 40;
  PnlTimeBar.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#48BB78');
  PnlTimeBar.SetclProSettings(PnlTimeBar.clProSettings);

  LblInstruction.Text = 'Hazır mısın?';
  LblInstruction.clProSettings.FontColor = clAlphaColor.clWhite;
  LblInstruction.SetclProSettings(LblInstruction.clProSettings);

  BtnStart.Visible = True;
  BtnRestart.Visible = False;
  BtnDepremContinue.Visible = False;
}

// Başarılı bitince ana hikayeye devam ettiren tek ek bağlantı.
void DepremOyunuDevam;
{
  SesClickCal;
  SesDepremDurdur;
  GameContainer.Visible = False;
  ShakeTimer.Enabled = False;
  GameTimer.Enabled = False;

  pnlMenu.Visible = False;
  pnlSahne1.Visible = False;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = True;
  pnlSahne4.Visible = False;
  pnlCanta.Visible = False;
  pnlParkur.Visible = False;
}


// ========== HIKAYE FONKSIYONLARI (DOĞRU SIRADA!) ==========

void Sahne1Goster;
{
  pnlMenu.Visible = False;
  pnlSahne1.Visible = True;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = False;
  pnlSahne4.Visible = False;
  pnlCanta.Visible = False;
  pnlParkur.Visible = False;
  GameContainer.Visible = False;
}

void Sahne2Goster;
{
  pnlSahne2.Visible = True;
  pnlCanta.Visible = False;
  GameContainer.Visible = False;
}

void Sahne3Goster;
{
  pnlSahne3.Visible = True;
  GameContainer.Visible = False;
}

void Sahne4Goster;
{
  SesDepremDurdur;
  SesParkurFonDurdur;
  pnlMenu.Visible = False;
  pnlSahne1.Visible = False;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = False;
  pnlCanta.Visible = False;
  pnlParkur.Visible = False;
  GameContainer.Visible = False;
  pnlSahne4.Visible = True;

  tmrParkur.Enabled = False;
  tmrMoloz.Enabled = False;
  tmrParkurSure.Enabled = False;
}

void Sahne1Devam;
{
  SesClickCal;
  pnlSahne1.Visible = False;
  CantaAc;
}

void Sahne2Devam;
{
  SesClickCal;
  pnlSahne2.Visible = False;
  DepremOyunuAc;
}

void Sahne3Devam;
{
  SesClickCal;
  pnlSahne3.Visible = False;
  ParkurAc;
}

void Sahne4Devam;
{
  SesClickCal;
  pnlSahne4.Visible = False;
  MenuGoster;
}

// ========== PARKUR YARDIMCI FONKSIYONLARI ==========

void ParkurSureGuncelle;
{
  parkurSure = parkurSure - 1;
  lblParkurSure.Text = 'Sure: ' + IntToStr(parkurSure) + 's';
  if(parkurSure <= 0)
  {
    tmrParkur.Enabled = False;
    tmrMoloz.Enabled = False;
    tmrParkurSure.Enabled = False;
    ShowMessage('SURE DOLDU! Tekrar dene!');
    MenuGoster;
  }
}

void ParkurOldu;
{
  SesDusmeCal;
parkurCan = parkurCan - 1;

  if(parkurCan == 2)
  {
    lblParkurCan.Text = '❤️ ❤️ 🖤';
  }
  else if(parkurCan == 1)
  {
    lblParkurCan.Text = '❤️ 🖤 🖤';
  }
  else if(parkurCan <= 0)
  {
    lblParkurCan.Text = '🖤 🖤 🖤';
    tmrParkur.Enabled = False;
    tmrMoloz.Enabled = False;
    tmrParkurSure.Enabled = False;
    ShowMessage('HAYATINI KAYBETTIN! Tekrar dene!');
    MenuGoster;
    Exit;
  }
  
  imgKarakter.Position.X = checkpointX;
  imgKarakter.Position.Y = checkpointY;
  karakterCember.Position.X = checkpointX;
  karakterCember.Position.Y = checkpointY;
  velocityY = 0;
  havada = False;
  solGidiyor = False;
  sagGidiyor = False;
}

void MolozDusur;
var
  rastgele: Integer;
{
  // Bu surumde havadan dusen moloz yok.
  rastgele = 0;
}

void MolozHareket;
{
  // Bu surumde havadan dusen moloz yok.
}

// ========== PARKUR FONKSIYONLARI ==========


void ParkurFinalBitir;
{
  SesParkurFonDurdur;
  velocityY = 0;
  havada = False;
  solGidiyor = False;
  sagGidiyor = False;

  tmrParkur.Enabled = False;
  tmrMoloz.Enabled = False;
  tmrParkurSure.Enabled = False;

  animIdle.Stop;
  animRun.Stop;
  animJump.Stop;


  pnlMenu.Visible = False;
  pnlSahne1.Visible = False;
  pnlSahne2.Visible = False;
  pnlSahne3.Visible = False;
  pnlCanta.Visible = False;
  pnlParkur.Visible = False;
  GameContainer.Visible = False;
  pnlSahne4.Visible = True;
}

void PlatformaOtur(p: TclImage);
{
  karakterCember.Position.Y = p.Position.Y - karakterCember.Height;
  imgKarakter.Position.Y = karakterCember.Position.Y;
  velocityY = 0;
  havada = False;
}

void CheckpointYap(p: TclImage);
{
  PlatformaOtur(p);
  checkpointX = p.Position.X;
  checkpointY = p.Position.Y - karakterCember.Height;
}

void ParkurKontrol;
var
  platformda: Boolean;
  solAyakX: Integer;
  sagAyakX: Integer;
  oncekiAlt: Integer;
{
  platformda = False;
  solAyakX = karakterCember.Position.X + 9;
  sagAyakX = karakterCember.Position.X + karakterCember.Width - 9;
  oncekiAlt = (karakterCember.Position.Y + karakterCember.Height) - velocityY;

  if((parkurBolum == 1) &&
     (checkpoint2.Visible) &&
     (karakterCember.Position.X + karakterCember.Width > checkpoint2.Position.X + 3) &&
     (karakterCember.Position.X < checkpoint2.Position.X + checkpoint2.Width - 3) &&
     (karakterCember.Position.Y + karakterCember.Height >= checkpoint2.Position.Y - 10) &&
     (karakterCember.Position.Y + karakterCember.Height <= checkpoint2.Position.Y + 24) &&
     (velocityY >= 0))
  {
    PlatformaOtur(checkpoint2);
    ParkurBolumGec;
    Exit;
  }

  if((parkurBolum == 2) &&
     (pltfBitis.Visible) &&
     (karakterCember.Position.X + karakterCember.Width > pltfBitis.Position.X + 2) &&
     (karakterCember.Position.X < pltfBitis.Position.X + pltfBitis.Width - 2) &&
     (karakterCember.Position.Y + karakterCember.Height >= pltfBitis.Position.Y - 12) &&
     (karakterCember.Position.Y + karakterCember.Height <= pltfBitis.Position.Y + 26) &&
     (velocityY >= 0))
  {
    PlatformaOtur(pltfBitis);
    ParkurFinalBitir;
    Exit;
  }

  if((pltf1.Visible) && (solAyakX >= pltf1.Position.X - 10) && (sagAyakX <= pltf1.Position.X + pltf1.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf1.Position.Y) && (oncekiAlt <= pltf1.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf1); }
  if((pltf2.Visible) && (solAyakX >= pltf2.Position.X - 10) && (sagAyakX <= pltf2.Position.X + pltf2.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf2.Position.Y) && (oncekiAlt <= pltf2.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf2); }
  if((pltf3.Visible) && (solAyakX >= pltf3.Position.X - 10) && (sagAyakX <= pltf3.Position.X + pltf3.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf3.Position.Y) && (oncekiAlt <= pltf3.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf3); }
  if((checkpoint1.Visible) && (solAyakX >= checkpoint1.Position.X - 10) && (sagAyakX <= checkpoint1.Position.X + checkpoint1.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= checkpoint1.Position.Y) && (oncekiAlt <= checkpoint1.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; CheckpointYap(checkpoint1); }
  if((pltf4.Visible) && (solAyakX >= pltf4.Position.X - 10) && (sagAyakX <= pltf4.Position.X + pltf4.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf4.Position.Y) && (oncekiAlt <= pltf4.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf4); }
  if((pltf5.Visible) && (solAyakX >= pltf5.Position.X - 10) && (sagAyakX <= pltf5.Position.X + pltf5.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf5.Position.Y) && (oncekiAlt <= pltf5.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf5); }
  if((pltf6.Visible) && (solAyakX >= pltf6.Position.X - 10) && (sagAyakX <= pltf6.Position.X + pltf6.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf6.Position.Y) && (oncekiAlt <= pltf6.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf6); }
  if((pltf7.Visible) && (solAyakX >= pltf7.Position.X - 10) && (sagAyakX <= pltf7.Position.X + pltf7.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf7.Position.Y) && (oncekiAlt <= pltf7.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf7); }
  if((checkpoint2.Visible) && (solAyakX >= checkpoint2.Position.X - 10) && (sagAyakX <= checkpoint2.Position.X + checkpoint2.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= checkpoint2.Position.Y) && (oncekiAlt <= checkpoint2.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; CheckpointYap(checkpoint2); }
  if((pltf8.Visible) && (solAyakX >= pltf8.Position.X - 10) && (sagAyakX <= pltf8.Position.X + pltf8.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf8.Position.Y) && (oncekiAlt <= pltf8.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf8); }
  if((pltf9.Visible) && (solAyakX >= pltf9.Position.X - 10) && (sagAyakX <= pltf9.Position.X + pltf9.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf9.Position.Y) && (oncekiAlt <= pltf9.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf9); }
  if((pltf10.Visible) && (solAyakX >= pltf10.Position.X - 10) && (sagAyakX <= pltf10.Position.X + pltf10.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf10.Position.Y) && (oncekiAlt <= pltf10.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf10); }
  if((pltf11.Visible) && (solAyakX >= pltf11.Position.X - 10) && (sagAyakX <= pltf11.Position.X + pltf11.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf11.Position.Y) && (oncekiAlt <= pltf11.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf11); }
  if((pltf12.Visible) && (solAyakX >= pltf12.Position.X - 10) && (sagAyakX <= pltf12.Position.X + pltf12.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf12.Position.Y) && (oncekiAlt <= pltf12.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf12); }
  if((checkpoint3.Visible) && (solAyakX >= checkpoint3.Position.X - 10) && (sagAyakX <= checkpoint3.Position.X + checkpoint3.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= checkpoint3.Position.Y) && (oncekiAlt <= checkpoint3.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; CheckpointYap(checkpoint3); }
  if((pltf13.Visible) && (solAyakX >= pltf13.Position.X - 10) && (sagAyakX <= pltf13.Position.X + pltf13.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf13.Position.Y) && (oncekiAlt <= pltf13.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf13); }
  if((pltf14.Visible) && (solAyakX >= pltf14.Position.X - 10) && (sagAyakX <= pltf14.Position.X + pltf14.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltf14.Position.Y) && (oncekiAlt <= pltf14.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltf14); }
  if((pltfBitis.Visible) && (solAyakX >= pltfBitis.Position.X - 10) && (sagAyakX <= pltfBitis.Position.X + pltfBitis.Width + 10) && (karakterCember.Position.Y + karakterCember.Height >= pltfBitis.Position.Y) && (oncekiAlt <= pltfBitis.Position.Y + 10) && (velocityY >= 0))
  { platformda = True; PlatformaOtur(pltfBitis); if(parkurBolum == 2) { ParkurFinalBitir; Exit; } }

  if(platformda == False)
  {
    havada = True;
  }

  if(karakterCember.Position.Y > 470)
  {
    ParkurOldu;
    Exit;
  }
}

void ParkurHareket;
{
  if(havada)
  {
    JumpBaslat;
  }
  else if(solGidiyor || sagGidiyor)
  {
    RunBaslat;
  }
  else
  {
    IdleBaslat;
  }

  if(solGidiyor && (karakterCember.Position.X > 0))
  {
    karakterCember.Position.X = karakterCember.Position.X - karakterHiz;
    imgKarakter.Position.X = karakterCember.Position.X;
  }

  if(sagGidiyor && (karakterCember.Position.X < 340))
  {
    karakterCember.Position.X = karakterCember.Position.X + karakterHiz;
    imgKarakter.Position.X = karakterCember.Position.X;
  }

  if(havada)
  {
    velocityY = velocityY + yerCekimi;
    karakterCember.Position.Y = karakterCember.Position.Y + velocityY;
    imgKarakter.Position.Y = karakterCember.Position.Y;
  }

  ParkurKontrol;
}

void ParkurSolBas;
{
  solGidiyor = True;
  ParkurHareket;
}
void ParkurSolBirak;
{
  solGidiyor = False;
}
void ParkurSagBas;
{
  sagGidiyor = True;
  ParkurHareket;
}
void ParkurSagBirak;
{
  sagGidiyor = False;
}
void ParkurZipla;
{
  if(havada == False)
  {
    velocityY = -20;
    havada = True;
    JumpBaslat;
    SesZiplaCal;
    ParkurHareket;
  }
}

// ========== CANTA FONKSIYONLARI ==========

void EsyaTiklandi;
var
  tiklananPanel: TclProPanel;
  id: Integer;
  emoji: String;
  dogru: Boolean;
{
  tiklananPanel = TclProPanel(Form1.clSender); 
  id = tiklananPanel.clTagInt; 
  emoji = tiklananPanel.clTagStr; 
  dogru = False;

  if(id == 1) { dogru = True; lblBilgiBaslik.Text = 'SU - DOGRU!'; lblBilgiIcerik.Text = 'Enkaz altinda su hayat kurtarir!'; }
  else if(id == 2) { dogru = True; lblBilgiBaslik.Text = 'ILK YARDIM - DOGRU!'; lblBilgiIcerik.Text = 'Pansuman ve ilaclar hayat kurtarir.'; }
  else if(id == 3) { dogru = True; lblBilgiBaslik.Text = 'FENER - DOGRU!'; lblBilgiIcerik.Text = 'Karanlikta yol bulmak icin sart!'; }
  else if(id == 4) { dogru = True; lblBilgiBaslik.Text = 'ILAC - DOGRU!'; lblBilgiIcerik.Text = 'Kronik hastalar icin onemli.'; }
  else if(id == 5) { dogru = True; lblBilgiBaslik.Text = 'DUDUK - DOGRU!'; lblBilgiIcerik.Text = 'Yardim cagirmak icin sesi cok uzaga gider!'; }
  else if(id == 6) { dogru = True; lblBilgiBaslik.Text = 'BATTANIYE - DOGRU!'; lblBilgiIcerik.Text = 'Soguk gecelerde korur.'; }
  else if(id == 7) { dogru = True; lblBilgiBaslik.Text = 'RADYO - DOGRU!'; lblBilgiIcerik.Text = 'Haber almak icin en guvenilir kaynak.'; }
  else if(id == 8) { dogru = True; lblBilgiBaslik.Text = 'PARA - DOGRU!'; lblBilgiIcerik.Text = 'ATM calismazken nakit gerekli.'; }
  else if(id == 11) { ShowMessage('YANLIS! Telefon sarj olmadan ise yaramaz!'); }
  else if(id == 12) { ShowMessage('YANLIS! Oyun konsolu cantaya girmez!'); }
  else if(id == 13) { ShowMessage('YANLIS! Parfum ise yaramaz!'); }
  else if(id == 14) { ShowMessage('YANLIS! Laptop cok agir!'); }

  if(dogru)
  {
    cantaPuan = cantaPuan + 10; 
    cantaKoyulan = cantaKoyulan + 1;
    SesCantaCal;
    
    
    
    lblCantaPuan.Text = 'Puan: ' + IntToStr(cantaPuan);
    
    tiklananPanel.Visible = False; 
    pnlBilgi.Visible = True;
    
    if (cantaIcerigi == '') 
      cantaIcerigi = emoji;
    else 
      cantaIcerigi = cantaIcerigi + ' ' + emoji;
      
    lblCantaIcerik.Text = cantaIcerigi; 
    
    if(cantaKoyulan >= 8) 
    { 
      tmrCanta.Enabled = False; 
      Sahne2Goster;
    }
  }
}

void BilgiKapat; {
  SesClickCal;
  SesClickCal; pnlBilgi.Visible = False; }

void CantaSureGuncelle;
{
  cantaSure = cantaSure - 1;
  lblCantaSure.Text = 'Sure: ' + IntToStr(cantaSure) + 's';
  if(cantaSure <= 0) { tmrCanta.Enabled = False; ShowMessage('SURE DOLDU! Puan: ' + IntToStr(cantaPuan)); }
}

void EsyaYap(pnl: TclProPanel; lbl: TclLabel; x, y, id: Integer; emoji, ad: String);
{
  pnl.Align = alNone; pnl.Position.X = x; pnl.Position.Y = y;
  pnl.Width = 90; pnl.Height = 70;
  pnl.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#34495e');
  pnl.clProSettings.IsRound = True; pnl.clProSettings.RoundHeight = 12; pnl.clProSettings.RoundWidth = 12;
  pnl.SetclProSettings(pnl.clProSettings);
  
  pnl.clTagInt = id; 
  pnl.clTagStr = emoji; 
  
  lbl.Align = alClient; lbl.Text = emoji + #13 + ad; lbl.StyledSettings = ssFamily;
  lbl.TextSettings.Font.Size = 11; lbl.TextSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF');
  lbl.TextSettings.HorzAlign = taCenter; lbl.TextSettings.VertAlign = taCenter; lbl.HitTest = False;
  
  Form1.AddNewEvent(pnl, tbeOnClick, 'EsyaTiklandi');
}

// ========== ANA PROGRAM ==========

{
  Form1 = TclForm.Create(Self);
  // ===== SES DOSYALARI - GITHUB RAW =====
  // Deprem sesi hangi yontemle calisiyorsa butun sesler ayni yontemle yukleniyor.
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Jump_Clomosy.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Jump_Clomosy.mp3 ');
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Fall_2_Clomosy.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Fall_2_Clomosy.mp3 ');
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Deprm_Clomosy.mp3.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Deprm_Clomosy.mp3.mp3 ');
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Parkurfon_Clomosy.mp3.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Parkurfon_Clomosy.mp3.mp3 ');
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_click_Clomosy.mp3.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_click_Clomosy.mp3.mp3 ');
  Form1.AddAssetFromUrl(' https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Canta_Clomosy.mp3.mp3" rel="nofollow - https://raw.githubusercontent.com/MustafaYigitDinc/assets/main/Masc_Canta_Clomosy.mp3.mp3 ');

  // ===== SES DOSYALARI - GITHUB RAW =====
  // Deprem sesi bu yontemle calistigi icin tum sesler ayni yonteme alindi.





  // ===== SES DOSYALARI - GITHUB RAW =====
  // RegisterSound / PlayGameSound icin AddGameAssetFromUrl kullaniliyor.


  // Arka plan / uzun sesler MediaPlayer ile calacak ama dosyalar yine AppFilesPath'e indiriliyor.


  // ===== SES DOSYALARI - GITHUB RAW =====


  // ===== SES DOSYALARI - GITHUB RAW =====


  // ===== SES EFEKTLERI =====
  // Hepsi deprem sesiyle birebir ayni mantik:
  // TclMediaPlayer.Create + FileName = clPathCombine(...) + CurrentTime = 0 + Play.
  SndZipla = TclMediaPlayer.Create(Form1);
  SndZipla.FileName = clPathCombine('Masc_Jump_Clomosy.mp3', Clomosy.AppFilesPath);
  SndZipla.Volume = 1.0;

  SndDusme = TclMediaPlayer.Create(Form1);
  SndDusme.FileName = clPathCombine('Masc_Fall_2_Clomosy.mp3', Clomosy.AppFilesPath);
  SndDusme.Volume = 1.0;

  SndDeprem = TclMediaPlayer.Create(Form1);
  SndDeprem.FileName = clPathCombine('Masc_Deprm_Clomosy.mp3.mp3', Clomosy.AppFilesPath);
  SndDeprem.Volume = 0.70;

  SndParkurFon = TclMediaPlayer.Create(Form1);
  SndParkurFon.FileName = clPathCombine('Masc_Parkurfon_Clomosy.mp3.mp3', Clomosy.AppFilesPath);
  SndParkurFon.Volume = 1.0;

  SndClick = TclMediaPlayer.Create(Form1);
  SndClick.FileName = clPathCombine('Masc_click_Clomosy.mp3.mp3', Clomosy.AppFilesPath);
  SndClick.Volume = 0.85;

  SndCanta = TclMediaPlayer.Create(Form1);
  SndCanta.FileName = clPathCombine('Masc_Canta_Clomosy.mp3.mp3', Clomosy.AppFilesPath);
  SndCanta.Volume = 1.0;

  pnlMenu = Form1.AddNewProPanel(Form1, 'pnlMenu'); pnlMenu.Align = alClient; pnlMenu.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#1e293b'); pnlMenu.SetclProSettings(pnlMenu.clProSettings);
  lblMenuBaslik = Form1.AddNewLabel(pnlMenu, 'lblMenuBaslik', 'DEPREM EGITIMI'); lblMenuBaslik.Align = alTop; lblMenuBaslik.Height = 120; lblMenuBaslik.StyledSettings = ssFamily; lblMenuBaslik.TextSettings.Font.Size = 28; lblMenuBaslik.TextSettings.FontColor = clAlphaColor.clHexToColor('#f59e0b'); lblMenuBaslik.TextSettings.HorzAlign = taCenter; lblMenuBaslik.TextSettings.VertAlign = taCenter;

  btnOyunaBasla = Form1.AddNewProButton(pnlMenu, 'btnOyunaBasla', 'OYUNA BASLA'); btnOyunaBasla.Align = alNone; btnOyunaBasla.Position.X = 50; btnOyunaBasla.Position.Y = 210; btnOyunaBasla.Width = 290; btnOyunaBasla.Height = 80; btnOyunaBasla.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#10b981'); btnOyunaBasla.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnOyunaBasla.clProSettings.FontSize = 20; btnOyunaBasla.clProSettings.IsRound = True; btnOyunaBasla.clProSettings.RoundHeight = 20; btnOyunaBasla.clProSettings.RoundWidth = 20; btnOyunaBasla.SetclProSettings(btnOyunaBasla.clProSettings); Form1.AddNewEvent(btnOyunaBasla, tbeOnClick, 'Sahne1Goster');
  btnMenuCikis = Form1.AddNewProButton(pnlMenu, 'btnMenuCikis', 'CIKIS'); btnMenuCikis.Align = alNone; btnMenuCikis.Position.X = 50; btnMenuCikis.Position.Y = 310; btnMenuCikis.Width = 290; btnMenuCikis.Height = 80; btnMenuCikis.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#ef4444'); btnMenuCikis.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnMenuCikis.clProSettings.FontSize = 20; btnMenuCikis.clProSettings.IsRound = True; btnMenuCikis.clProSettings.RoundHeight = 20; btnMenuCikis.clProSettings.RoundWidth = 20; btnMenuCikis.SetclProSettings(btnMenuCikis.clProSettings); Form1.AddNewEvent(btnMenuCikis, tbeOnClick, 'MenuCikis');

  // ===== SAHNE 1: CANTA HAZIRLAMA =====
  pnlSahne1 = Form1.AddNewProPanel(Form1, 'pnlSahne1'); pnlSahne1.Align = alClient; pnlSahne1.Visible = False; pnlSahne1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlSahne1.SetclProSettings(pnlSahne1.clProSettings);
  imgSahne1 = Form1.AddNewImage(pnlSahne1, 'imgSahne1'); imgSahne1.Align = alClient;
  Form1.AddAssetFromUrl(' https://i.ibb.co/bjk2md2Y/ANTA-HAZ-RLAMA.png" rel="nofollow - https://i.ibb.co/bjk2md2Y/ANTA-HAZ-RLAMA.png ');
  imgSahne1.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'ANTA-HAZ-RLAMA.png');
  btnDevam1 = Form1.AddNewProButton(pnlSahne1, 'btnDevam1', 'DEVAM >>'); btnDevam1.Align = alBottom; btnDevam1.Height = 60; btnDevam1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#10b981'); btnDevam1.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnDevam1.clProSettings.FontSize = 18; btnDevam1.SetclProSettings(btnDevam1.clProSettings); Form1.AddNewEvent(btnDevam1, tbeOnClick, 'Sahne1Devam');

  // ===== SAHNE 2: DEPREM ANI =====
  pnlSahne2 = Form1.AddNewProPanel(Form1, 'pnlSahne2'); pnlSahne2.Align = alClient; pnlSahne2.Visible = False; pnlSahne2.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlSahne2.SetclProSettings(pnlSahne2.clProSettings);
  imgSahne2 = Form1.AddNewImage(pnlSahne2, 'imgSahne2'); imgSahne2.Align = alClient;
  Form1.AddAssetFromUrl(' https://i.ibb.co/spFVwfJt/DEPREM-AN.png" rel="nofollow - https://i.ibb.co/spFVwfJt/DEPREM-AN.png ');
  imgSahne2.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'DEPREM-AN.png');
  btnDevam2 = Form1.AddNewProButton(pnlSahne2, 'btnDevam2', 'DEVAM >>'); btnDevam2.Align = alBottom; btnDevam2.Height = 60; btnDevam2.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#ef4444'); btnDevam2.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnDevam2.clProSettings.FontSize = 18; btnDevam2.SetclProSettings(btnDevam2.clProSettings); Form1.AddNewEvent(btnDevam2, tbeOnClick, 'Sahne2Devam');


  // ===== DEPREM ANI OYUNU - ORIJINAL deprem_oyunu.tro ARAYUZ =====
  IsGameActive = False;

  // 1. OYUN ALANI KONTEYNERİ (Siyah çerçeve)
  GameContainer = Form1.AddNewProPanel(Form1, 'GameContainer');
  GameContainer.Align = alClient;
  GameContainer.Visible = False;
  GameContainer.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#1A202C');
  GameContainer.SetclProSettings(GameContainer.clProSettings);

  // 2. SÜRE ÇUBUĞU (Bar)
  PnlTopBar = Form1.AddNewProPanel(GameContainer, 'PnlTopBar');
  PnlTopBar.Align = alTop; PnlTopBar.Height = 20; 
  PnlTopBar.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#4A5568'); // Gri Arka
  PnlTopBar.clProSettings.RoundWidth = 5;
  PnlTopBar.SetclProSettings(PnlTopBar.clProSettings);

  PnlTimeBar = Form1.AddNewProPanel(PnlTopBar, 'PnlTimeBar');
  PnlTimeBar.Align = alLeft; PnlTimeBar.Width = Form1.clWidth - 40; // Full
  PnlTimeBar.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#48BB78'); // Yeşil
  PnlTimeBar.clProSettings.RoundWidth = 5;
  PnlTimeBar.SetclProSettings(PnlTimeBar.clProSettings);

  // 3. SALLANAN ODA (Tüm nesneler bunun içinde)
  PnlRoom = Form1.AddNewProPanel(GameContainer, 'PnlRoom');
  PnlRoom.Align = alClient;
  PnlRoom.clProSettings.BackgroundColor = clAlphaColor.clWhite;
  PnlRoom.clProSettings.BorderColor = clAlphaColor.clBlack; PnlRoom.clProSettings.BorderWidth = 3;
  PnlRoom.SetclProSettings(PnlRoom.clProSettings);

  // --- ODA NESNELERİ ---

  // Dolap (Tehlikeli)
  ImgShelf = Form1.AddNewProImage(PnlRoom, 'ImgShelf');
  ImgShelf.Width = 100; ImgShelf.Height = 180;
  ImgShelf.Align = alLeft; ImgShelf.Margins.Left = 10; ImgShelf.Margins.Top = 50;
  ImgShelf.clProSettings.PictureSource = ' https://cdn-icons-png.flaticon.com/512/2964/2964509.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/2964/2964509.png ';
  ImgShelf.SetclProSettings(ImgShelf.clProSettings);
  ImgShelf.clTagInt = 3; Form1.AddNewEvent(ImgShelf, tbeOnClick, 'ObjectClick');

  // Pencere (Tehlikeli)
  ImgWindow = Form1.AddNewProImage(PnlRoom, 'ImgWindow');
  ImgWindow.Width = 120; ImgWindow.Height = 120;
  ImgWindow.Align = alRight; ImgWindow.Margins.Right = 10; ImgWindow.Margins.Top = 40;
  ImgWindow.clProSettings.PictureSource = ' https://cdn-icons-png.flaticon.com/512/2401/2401138.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/2401/2401138.png ';
  ImgWindow.SetclProSettings(ImgWindow.clProSettings);
  ImgWindow.clTagInt = 2; Form1.AddNewEvent(ImgWindow, tbeOnClick, 'ObjectClick');

  // Avize (Tehlikeli - Üstte)
  ImgChandelier = Form1.AddNewProImage(PnlRoom, 'ImgChandelier');
  ImgChandelier.Width = 80; ImgChandelier.Height = 80;
  ImgChandelier.Align = alTop; 
  ImgChandelier.clProSettings.PictureSource = ' https://cdn-icons-png.flaticon.com/512/895/895632.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/895/895632.png '; // Lamba ikonu
  ImgChandelier.SetclProSettings(ImgChandelier.clProSettings);
  ImgChandelier.clTagInt = 4; Form1.AddNewEvent(ImgChandelier, tbeOnClick, 'ObjectClick');

  // MASA (GÜVENLİ ALAN)
  ImgTable = Form1.AddNewProImage(PnlRoom, 'ImgTable');
  ImgTable.Width = 150; ImgTable.Height = 120;
  ImgTable.Align = alBottom; ImgTable.Margins.Bottom = 100; // Ortaya yakın alt
  ImgTable.clProSettings.PictureSource = ' https://cdn-icons-png.flaticon.com/512/1663/1663945.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/1663/1663945.png ';
  ImgTable.SetclProSettings(ImgTable.clProSettings);
  ImgTable.clTagInt = 1; Form1.AddNewEvent(ImgTable, tbeOnClick, 'ObjectClick');

  // --- KONTROLLER ---

  LblInstruction = Form1.AddNewProLabel(GameContainer, 'LblInstruction', 'Hazır mısın?');
  LblInstruction.Align = alBottom; LblInstruction.Height = 40; LblInstruction.Margins.Bottom = 10;
  LblInstruction.clProSettings.FontColor = clAlphaColor.clWhite;
  LblInstruction.clProSettings.FontSize = 14;
  LblInstruction.clProSettings.FontHorzAlign = palCenter;
  LblInstruction.SetclProSettings(LblInstruction.clProSettings);

  BtnStart = Form1.AddNewProButton(GameContainer, 'BtnStart', 'BAŞLAT');
  BtnStart.Align = alBottom; BtnStart.Height = 50; 
  BtnStart.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#ED8936');
  BtnStart.clProSettings.FontColor = clAlphaColor.clWhite;
  BtnStart.clProSettings.RoundWidth = 10;
  BtnStart.SetclProSettings(BtnStart.clProSettings);
  Form1.AddNewEvent(BtnStart, tbeOnClick, 'StartGame');

  BtnRestart = Form1.AddNewProButton(GameContainer, 'BtnRestart', 'TEKRAR DENE');
  BtnRestart.Align = alBottom; BtnRestart.Height = 50; 
  BtnRestart.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#4299E1');
  BtnRestart.clProSettings.FontColor = clAlphaColor.clWhite;
  BtnRestart.clProSettings.RoundWidth = 10;
  BtnRestart.SetclProSettings(BtnRestart.clProSettings);
  Form1.AddNewEvent(BtnRestart, tbeOnClick, 'StartGame');
  BtnRestart.Visible = False;

  BtnDepremContinue = Form1.AddNewProButton(GameContainer, 'BtnDepremContinue', 'DEVAM ET');
  BtnDepremContinue.Align = alBottom; BtnDepremContinue.Height = 50; 
  BtnDepremContinue.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#48BB78');
  BtnDepremContinue.clProSettings.FontColor = clAlphaColor.clWhite;
  BtnDepremContinue.clProSettings.RoundWidth = 10;
  BtnDepremContinue.SetclProSettings(BtnDepremContinue.clProSettings);
  Form1.AddNewEvent(BtnDepremContinue, tbeOnClick, 'DepremOyunuDevam');
  BtnDepremContinue.Visible = False;

  // --- TIMER AYARLARI ---

  // Sarsıntı Timer (Çok hızlı - 50ms)
  ShakeTimer = Form1.AddNewTimer(Form1, 'ShakeTimer', 50);
  ShakeTimer.Enabled = False;
  Form1.AddNewEvent(ShakeTimer, tbeOnTimer, 'ShakeRoom');

  // Oyun Süresi Timer (Orta hız - 100ms akıcılık için)
  GameTimer = Form1.AddNewTimer(Form1, 'GameTimer', 100);
  GameTimer.Enabled = False;
  Form1.AddNewEvent(GameTimer, tbeOnTimer, 'OnTimeTick');


  // ===== SAHNE 3: YIKIM MANZARASI =====
  pnlSahne3 = Form1.AddNewProPanel(Form1, 'pnlSahne3'); pnlSahne3.Align = alClient; pnlSahne3.Visible = False; pnlSahne3.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlSahne3.SetclProSettings(pnlSahne3.clProSettings);
  imgSahne3 = Form1.AddNewImage(pnlSahne3, 'imgSahne3'); imgSahne3.Align = alClient;
  Form1.AddAssetFromUrl(' https://i.ibb.co/SXpwBckk/SON-sahne.png" rel="nofollow - https://i.ibb.co/SXpwBckk/SON-sahne.png ');
  imgSahne3.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'SON-sahne.png');
  btnDevam3 = Form1.AddNewProButton(pnlSahne3, 'btnDevam3', 'PARKURA BASLA >>'); btnDevam3.Align = alBottom; btnDevam3.Height = 60; btnDevam3.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#3b82f6'); btnDevam3.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnDevam3.clProSettings.FontSize = 18; btnDevam3.SetclProSettings(btnDevam3.clProSettings); Form1.AddNewEvent(btnDevam3, tbeOnClick, 'Sahne3Devam');

  // ===== SAHNE 4: KURTARILIS =====
  pnlSahne4 = Form1.AddNewProPanel(Form1, 'pnlSahne4'); pnlSahne4.Align = alClient; pnlSahne4.Visible = False; pnlSahne4.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlSahne4.SetclProSettings(pnlSahne4.clProSettings);
  imgSahne4 = Form1.AddNewImage(pnlSahne4, 'imgSahne4'); imgSahne4.Align = alClient;
  Form1.AddAssetFromUrl(' https://i.ibb.co/Wvmgm08F/Chat-GPT-mage-7-Mar-2026-12-20-51.png" rel="nofollow - https://i.ibb.co/Wvmgm08F/Chat-GPT-mage-7-Mar-2026-12-20-51.png ');
  imgSahne4.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'Chat-GPT-mage-7-Mar-2026-12-20-51.png');
  btnDevam4 = Form1.AddNewProButton(pnlSahne4, 'btnDevam4', 'ANNE KURTARILDI - MENUYE DON'); btnDevam4.Align = alBottom; btnDevam4.Height = 60; btnDevam4.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#10b981'); btnDevam4.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnDevam4.clProSettings.FontSize = 18; btnDevam4.SetclProSettings(btnDevam4.clProSettings); Form1.AddNewEvent(btnDevam4, tbeOnClick, 'Sahne4Devam');

  // ===== PARKUR OYUNU =====
  pnlParkur = Form1.AddNewProPanel(Form1, 'pnlParkur'); pnlParkur.Align = alClient; pnlParkur.Visible = False; pnlParkur.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlParkur.SetclProSettings(pnlParkur.clProSettings);
  
  imgParkurArka = Form1.AddNewImage(pnlParkur, 'imgParkurArka'); imgParkurArka.Align = alClient; imgParkurArka.HitTest = False;
  imgParkurArka.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'parkur_arkaplan_ruins.png');
  
  pnlParkurUst = Form1.AddNewPanel(pnlParkur, 'pnlParkurUst'); pnlParkurUst.Align = alTop; pnlParkurUst.Height = 42;
  lblParkurBaslik = Form1.AddNewLabel(pnlParkurUst, 'lblParkurBaslik', 'PARKUR'); lblParkurBaslik.Align = alLeft; lblParkurBaslik.Width = 130; lblParkurBaslik.StyledSettings = ssFamily; lblParkurBaslik.TextSettings.Font.Size = 15; lblParkurBaslik.TextSettings.FontColor = clAlphaColor.clHexToColor('#f59e0b');
  lblParkurCan = Form1.AddNewLabel(pnlParkurUst, 'lblParkurCan', '❤️ ❤️ ❤️'); lblParkurCan.Align = alRight; lblParkurCan.Width = 105; lblParkurCan.StyledSettings = ssFamily; lblParkurCan.TextSettings.Font.Size = 13;
  lblParkurSure = Form1.AddNewLabel(pnlParkurUst, 'lblParkurSure', 'Sure: 60s'); lblParkurSure.Align = alRight; lblParkurSure.Width = 90; lblParkurSure.StyledSettings = ssFamily; lblParkurSure.TextSettings.Font.Size = 12; lblParkurSure.TextSettings.FontColor = clAlphaColor.clHexToColor('#ef4444');

  

  pltf1 = Form1.AddNewImage(pnlParkur, 'pltf1'); pltf1.Align = alNone; pltf1.Position.X = 50; pltf1.Position.Y = 350; pltf1.Width = 120; pltf1.Height = 20; pltf1.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf2 = Form1.AddNewImage(pnlParkur, 'pltf2'); pltf2.Align = alNone; pltf2.Position.X = 200; pltf2.Position.Y = 320; pltf2.Width = 90; pltf2.Height = 20; pltf2.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf3 = Form1.AddNewImage(pnlParkur, 'pltf3'); pltf3.Align = alNone; pltf3.Position.X = 320; pltf3.Position.Y = 280; pltf3.Width = 100; pltf3.Height = 20; pltf3.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  checkpoint1 = Form1.AddNewImage(pnlParkur, 'checkpoint1'); checkpoint1.Align = alNone; checkpoint1.Position.X = 450; checkpoint1.Position.Y = 240; checkpoint1.Width = 110; checkpoint1.Height = 20; checkpoint1.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  pltf4 = Form1.AddNewImage(pnlParkur, 'pltf4'); pltf4.Align = alNone; pltf4.Position.X = 590; pltf4.Position.Y = 200; pltf4.Width = 80; pltf4.Height = 20; pltf4.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf5 = Form1.AddNewImage(pnlParkur, 'pltf5'); pltf5.Align = alNone; pltf5.Position.X = 700; pltf5.Position.Y = 170; pltf5.Width = 90; pltf5.Height = 20; pltf5.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf6 = Form1.AddNewImage(pnlParkur, 'pltf6'); pltf6.Align = alNone; pltf6.Position.X = 820; pltf6.Position.Y = 140; pltf6.Width = 100; pltf6.Height = 20; pltf6.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf7 = Form1.AddNewImage(pnlParkur, 'pltf7'); pltf7.Align = alNone; pltf7.Position.X = 950; pltf7.Position.Y = 110; pltf7.Width = 85; pltf7.Height = 20; pltf7.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  checkpoint2 = Form1.AddNewImage(pnlParkur, 'checkpoint2'); checkpoint2.Align = alNone; checkpoint2.Position.X = 1060; checkpoint2.Position.Y = 80; checkpoint2.Width = 110; checkpoint2.Height = 20; checkpoint2.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  pltf8 = Form1.AddNewImage(pnlParkur, 'pltf8'); pltf8.Align = alNone; pltf8.Position.X = 1200; pltf8.Position.Y = 120; pltf8.Width = 95; pltf8.Height = 20; pltf8.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf9 = Form1.AddNewImage(pnlParkur, 'pltf9'); pltf9.Align = alNone; pltf9.Position.X = 1330; pltf9.Position.Y = 160; pltf9.Width = 90; pltf9.Height = 20; pltf9.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf10 = Form1.AddNewImage(pnlParkur, 'pltf10'); pltf10.Align = alNone; pltf10.Position.X = 1460; pltf10.Position.Y = 200; pltf10.Width = 85; pltf10.Height = 20; pltf10.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf11 = Form1.AddNewImage(pnlParkur, 'pltf11'); pltf11.Align = alNone; pltf11.Position.X = 1580; pltf11.Position.Y = 160; pltf11.Width = 90; pltf11.Height = 20; pltf11.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf12 = Form1.AddNewImage(pnlParkur, 'pltf12'); pltf12.Align = alNone; pltf12.Position.X = 1700; pltf12.Position.Y = 120; pltf12.Width = 80; pltf12.Height = 20; pltf12.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  checkpoint3 = Form1.AddNewImage(pnlParkur, 'checkpoint3'); checkpoint3.Align = alNone; checkpoint3.Position.X = 1790; checkpoint3.Position.Y = 80; checkpoint3.Width = 110; checkpoint3.Height = 20; checkpoint3.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  
  pltf13 = Form1.AddNewImage(pnlParkur, 'pltf13'); pltf13.Align = alNone; pltf13.Position.X = 1930; pltf13.Position.Y = 110; pltf13.Width = 90; pltf13.Height = 20; pltf13.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltf14 = Form1.AddNewImage(pnlParkur, 'pltf14'); pltf14.Align = alNone; pltf14.Position.X = 2050; pltf14.Position.Y = 140; pltf14.Width = 100; pltf14.Height = 20; pltf14.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');
  pltfBitis = Form1.AddNewImage(pnlParkur, 'pltfBitis'); pltfBitis.Align = alNone; pltfBitis.Position.X = 2140; pltfBitis.Position.Y = 140; pltfBitis.Width = 180; pltfBitis.Height = 20; pltfBitis.Bitmap.LoadFromFile(Clomosy.AppFilesPath + 'rubble_platform.png');

  moloz1 = Form1.AddNewPanel(pnlParkur, 'moloz1'); moloz1.Align = alNone; moloz1.Position.X = 300; moloz1.Position.Y = -100; moloz1.Width = 40; moloz1.Height = 40;
  moloz2 = Form1.AddNewPanel(pnlParkur, 'moloz2'); moloz2.Align = alNone; moloz2.Position.X = 600; moloz2.Position.Y = -100; moloz2.Width = 40; moloz2.Height = 40;
  moloz3 = Form1.AddNewPanel(pnlParkur, 'moloz3'); moloz3.Align = alNone; moloz3.Position.X = 900; moloz3.Position.Y = -100; moloz3.Width = 40; moloz3.Height = 40;

  imgKarakter = Form1.AddNewImage(pnlParkur, 'imgKarakter'); imgKarakter.Align = alNone; imgKarakter.Width = 60; imgKarakter.Height = 80; imgKarakter.Visible = False;
  karakterCember = Form1.AddNewCircle(pnlParkur, 'karakterCember'); karakterCember.Align = alNone; karakterCember.Width = 60; karakterCember.Height = 80; karakterCember.Fill.Kind = fbkBitmap; karakterCember.Fill.Bitmap.WrapMode = fbwmTileStretch; 

  Form1.AddAssetFromUrl(' https://i.ibb.co/7xpbg5dH/dle.png" rel="nofollow - https://i.ibb.co/7xpbg5dH/dle.png '); animIdle = Form1.AddNewBitmapListAnimation(karakterCember, 'animIdle'); animIdle.AnimationBitmap.LoadFromFile(Clomosy.AppFilesPath + 'dle.png'); animIdle.AnimationCount = 6; animIdle.AnimationRowCount = 1; animIdle.Loop = True; animIdle.Enabled = True; animIdle.PropertyName = 'Fill.Bitmap.Bitmap'; animIdle.Duration = 1.0;
  animWalk = Form1.AddNewBitmapListAnimation(karakterCember, 'animWalk'); animWalk.AnimationBitmap.LoadFromFile(Clomosy.AppFilesPath + 'dle.png'); animWalk.AnimationCount = 6; animWalk.AnimationRowCount = 1; animWalk.Loop = True; animWalk.Enabled = False; animWalk.PropertyName = 'Fill.Bitmap.Bitmap'; animWalk.Duration = 0.8;
  Form1.AddAssetFromUrl(' https://i.ibb.co/xqjD59zW/Run.png" rel="nofollow - https://i.ibb.co/xqjD59zW/Run.png '); animRun = Form1.AddNewBitmapListAnimation(karakterCember, 'animRun'); animRun.AnimationBitmap.LoadFromFile(Clomosy.AppFilesPath + 'Run.png'); animRun.AnimationCount = 8; animRun.AnimationRowCount = 1; animRun.Loop = True; animRun.Enabled = False; animRun.PropertyName = 'Fill.Bitmap.Bitmap'; animRun.Duration = 0.6;
  Form1.AddAssetFromUrl(' https://i.ibb.co/rf5NR8xw/Jump.png" rel="nofollow - https://i.ibb.co/rf5NR8xw/Jump.png '); animJump = Form1.AddNewBitmapListAnimation(karakterCember, 'animJump'); animJump.AnimationBitmap.LoadFromFile(Clomosy.AppFilesPath + 'Jump.png'); animJump.AnimationCount = 10; animJump.AnimationRowCount = 1; animJump.Loop = True; animJump.Enabled = False; animJump.PropertyName = 'Fill.Bitmap.Bitmap'; animJump.Duration = 0.5;

  pnlParkurKontrol = Form1.AddNewPanel(pnlParkur, 'pnlParkurKontrol'); pnlParkurKontrol.Align = alBottom; pnlParkurKontrol.Height = 95;
  btnParkurSol = Form1.AddNewButton(pnlParkurKontrol, 'btnParkurSol', '<'); btnParkurSol.Align = alLeft; btnParkurSol.Width = 105; Form1.AddNewEvent(btnParkurSol, tbeOnMouseDown, 'ParkurSolBas'); Form1.AddNewEvent(btnParkurSol, tbeOnMouseUp, 'ParkurSolBirak');
  btnParkurZipla = Form1.AddNewButton(pnlParkurKontrol, 'btnParkurZipla', 'ZIPLA'); btnParkurZipla.Align = alClient; Form1.AddNewEvent(btnParkurZipla, tbeOnMouseDown, 'ParkurZipla');
  btnParkurSag = Form1.AddNewButton(pnlParkurKontrol, 'btnParkurSag', '>'); btnParkurSag.Align = alRight; btnParkurSag.Width = 105; Form1.AddNewEvent(btnParkurSag, tbeOnMouseDown, 'ParkurSagBas'); Form1.AddNewEvent(btnParkurSag, tbeOnMouseUp, 'ParkurSagBirak');

  tmrParkur = Form1.AddNewTimer(Form1, 'tmrParkur', 20); tmrParkur.Enabled = False; Form1.AddNewEvent(tmrParkur, tbeOnTimer, 'ParkurHareket');
  tmrMoloz = Form1.AddNewTimer(Form1, 'tmrMoloz', 2000); tmrMoloz.Enabled = False; Form1.AddNewEvent(tmrMoloz, tbeOnTimer, 'MolozDusur');
  tmrParkurSure = Form1.AddNewTimer(Form1, 'tmrParkurSure', 1000); tmrParkurSure.Enabled = False; Form1.AddNewEvent(tmrParkurSure, tbeOnTimer, 'ParkurSureGuncelle');

  // ===== CANTA OYUNU =====
  pnlCanta = Form1.AddNewProPanel(Form1, 'pnlCanta'); pnlCanta.Align = alClient; pnlCanta.Visible = False; pnlCanta.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#0f172a'); pnlCanta.SetclProSettings(pnlCanta.clProSettings);
  pnlCantaUst = Form1.AddNewPanel(pnlCanta, 'pnlCantaUst'); pnlCantaUst.Align = alTop; pnlCantaUst.Height = 60;
  lblCantaBaslik = Form1.AddNewLabel(pnlCantaUst, 'lblCantaBaslik', 'DEPREM CANTASI'); lblCantaBaslik.Align = alLeft; lblCantaBaslik.Width = 155; lblCantaBaslik.StyledSettings = ssFamily; lblCantaBaslik.TextSettings.Font.Size = 15; lblCantaBaslik.TextSettings.FontColor = clAlphaColor.clHexToColor('#f59e0b');
  lblCantaPuan = Form1.AddNewLabel(pnlCantaUst, 'lblCantaPuan', 'Puan: 0'); lblCantaPuan.Align = alRight; lblCantaPuan.Width = 80; lblCantaPuan.StyledSettings = ssFamily; lblCantaPuan.TextSettings.Font.Size = 14; lblCantaPuan.TextSettings.FontColor = clAlphaColor.clHexToColor('#10b981');
  lblCantaSure = Form1.AddNewLabel(pnlCantaUst, 'lblCantaSure', 'Sure: 90s'); lblCantaSure.Align = alRight; lblCantaSure.Width = 80; lblCantaSure.StyledSettings = ssFamily; lblCantaSure.TextSettings.Font.Size = 14; lblCantaSure.TextSettings.FontColor = clAlphaColor.clHexToColor('#ef4444');
  
  pnlCantaAlt = Form1.AddNewPanel(pnlCanta, 'pnlCantaAlt'); pnlCantaAlt.Align = alBottom; pnlCantaAlt.Height = 40;
  lblCantaAciklama = Form1.AddNewLabel(pnlCantaAlt, 'lblCantaAciklama', 'Cantaya koymak istedigin esyalara TIKLA!'); lblCantaAciklama.Align = alClient; lblCantaAciklama.TextSettings.FontColor = clAlphaColor.clHexToColor('#94a3b8');

  pnlCantaAlan = Form1.AddNewPanel(pnlCanta, 'pnlCantaAlan'); pnlCantaAlan.Align = alClient;

  pnlTorba = Form1.AddNewProPanel(pnlCantaAlan, 'pnlTorba'); pnlTorba.Align = alNone; pnlTorba.Position.X = 95; pnlTorba.Position.Y = 475; pnlTorba.Width = 200; pnlTorba.Height = 145; pnlTorba.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#15803d'); pnlTorba.clProSettings.BorderColor = clAlphaColor.clHexToColor('#22c55e'); pnlTorba.clProSettings.BorderWidth = 4; pnlTorba.clProSettings.IsRound = True; pnlTorba.clProSettings.RoundHeight = 18; pnlTorba.clProSettings.RoundWidth = 18; pnlTorba.SetclProSettings(pnlTorba.clProSettings); 
  
  lblTorba = Form1.AddNewLabel(pnlTorba, 'lblTorba', '🎒 CANTAM'); lblTorba.Align = alTop; lblTorba.Height = 35; lblTorba.StyledSettings = ssFamily; lblTorba.TextSettings.Font.Size = 16; lblTorba.TextSettings.FontColor = clAlphaColor.clHexToColor('#fbbf24'); lblTorba.TextSettings.HorzAlign = taCenter; lblTorba.TextSettings.VertAlign = taCenter; 
  
  lblCantaIcerik = Form1.AddNewLabel(pnlTorba, 'lblCantaIcerik', ''); lblCantaIcerik.Align = alClient; lblCantaIcerik.StyledSettings = ssFamily; lblCantaIcerik.TextSettings.Font.Size = 20; lblCantaIcerik.TextSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); lblCantaIcerik.TextSettings.HorzAlign = taCenter; lblCantaIcerik.TextSettings.VertAlign = taCenter; lblCantaIcerik.WordWrap = True;

  pnlSu = Form1.AddNewProPanel(pnlCantaAlan, 'pnlSu'); lblSu = Form1.AddNewLabel(pnlSu, 'lblSu', ''); EsyaYap(pnlSu, lblSu, 15, 75, 1, '💧', 'Su');
  pnlIlkYardim = Form1.AddNewProPanel(pnlCantaAlan, 'pnlIlkYardim'); lblIlkYardim = Form1.AddNewLabel(pnlIlkYardim, 'lblIlkYardim', ''); EsyaYap(pnlIlkYardim, lblIlkYardim, 150, 75, 2, '🩹', 'Ilk Yardim'); 
  pnlFener = Form1.AddNewProPanel(pnlCantaAlan, 'pnlFener'); lblFener = Form1.AddNewLabel(pnlFener, 'lblFener', ''); EsyaYap(pnlFener, lblFener, 285, 75, 3, '🔦', 'Fener'); 
  pnlIlac = Form1.AddNewProPanel(pnlCantaAlan, 'pnlIlac'); lblIlac = Form1.AddNewLabel(pnlIlac, 'lblIlac', ''); EsyaYap(pnlIlac, lblIlac, 15, 160, 4, '💊', 'Ilac'); 
  pnlDuduk = Form1.AddNewProPanel(pnlCantaAlan, 'pnlDuduk'); lblDuduk = Form1.AddNewLabel(pnlDuduk, 'lblDuduk', ''); EsyaYap(pnlDuduk, lblDuduk, 150, 160, 5, '📯', 'Duduk'); 
  pnlBattaniye = Form1.AddNewProPanel(pnlCantaAlan, 'pnlBattaniye'); lblBattaniye = Form1.AddNewLabel(pnlBattaniye, 'lblBattaniye', ''); EsyaYap(pnlBattaniye, lblBattaniye, 285, 160, 6, '🛏️', 'Battaniye'); 
  pnlRadyo = Form1.AddNewProPanel(pnlCantaAlan, 'pnlRadyo'); lblRadyo = Form1.AddNewLabel(pnlRadyo, 'lblRadyo', ''); EsyaYap(pnlRadyo, lblRadyo, 15, 245, 7, '📻', 'Radyo'); 
  pnlPara = Form1.AddNewProPanel(pnlCantaAlan, 'pnlPara'); lblPara = Form1.AddNewLabel(pnlPara, 'lblPara', ''); EsyaYap(pnlPara, lblPara, 150, 245, 8, '💵', 'Para'); 
  pnlTelefon = Form1.AddNewProPanel(pnlCantaAlan, 'pnlTelefon'); lblTelefon = Form1.AddNewLabel(pnlTelefon, 'lblTelefon', ''); EsyaYap(pnlTelefon, lblTelefon, 285, 245, 11, '📱', 'Telefon'); 
  pnlKonsol = Form1.AddNewProPanel(pnlCantaAlan, 'pnlKonsol'); lblKonsol = Form1.AddNewLabel(pnlKonsol, 'lblKonsol', ''); EsyaYap(pnlKonsol, lblKonsol, 15, 330, 12, '🎮', 'Konsol'); 
  pnlPerfum = Form1.AddNewProPanel(pnlCantaAlan, 'pnlPerfum'); lblPerfum = Form1.AddNewLabel(pnlPerfum, 'lblPerfum', ''); EsyaYap(pnlPerfum, lblPerfum, 150, 330, 13, '🌸', 'Parfum'); 
  pnlLaptop = Form1.AddNewProPanel(pnlCantaAlan, 'pnlLaptop'); lblLaptop = Form1.AddNewLabel(pnlLaptop, 'lblLaptop', ''); EsyaYap(pnlLaptop, lblLaptop, 285, 330, 14, '💻', 'Laptop'); 
  
  pnlBilgi = Form1.AddNewProPanel(pnlCanta, 'pnlBilgi'); pnlBilgi.Align = alNone; pnlBilgi.Position.X = 25; pnlBilgi.Position.Y = 185; pnlBilgi.Width = 340; pnlBilgi.Height = 230; pnlBilgi.Visible = False; pnlBilgi.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#15803d'); pnlBilgi.clProSettings.BorderColor = clAlphaColor.clHexToColor('#22c55e'); pnlBilgi.clProSettings.BorderWidth = 5; pnlBilgi.clProSettings.IsRound = True; pnlBilgi.clProSettings.RoundHeight = 25; pnlBilgi.clProSettings.RoundWidth = 25; pnlBilgi.SetclProSettings(pnlBilgi.clProSettings);
  lblBilgiBaslik = Form1.AddNewLabel(pnlBilgi, 'lblBilgiBaslik', ''); lblBilgiBaslik.Align = alTop; lblBilgiBaslik.Height = 50; lblBilgiBaslik.StyledSettings = ssFamily; lblBilgiBaslik.TextSettings.Font.Size = 16; lblBilgiBaslik.TextSettings.FontColor = clAlphaColor.clHexToColor('#fbbf24'); lblBilgiBaslik.TextSettings.HorzAlign = taCenter; lblBilgiBaslik.TextSettings.VertAlign = taCenter;
  lblBilgiIcerik = Form1.AddNewLabel(pnlBilgi, 'lblBilgiIcerik', ''); lblBilgiIcerik.Align = alClient; lblBilgiIcerik.WordWrap = True; lblBilgiIcerik.Margins.Left = 20; lblBilgiIcerik.Margins.Right = 20; lblBilgiIcerik.Margins.Top = 10; lblBilgiIcerik.Margins.Bottom = 10; lblBilgiIcerik.TextSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF');
  btnBilgiKapat = Form1.AddNewProButton(pnlBilgi, 'btnBilgiKapat', 'Tamam'); btnBilgiKapat.Align = alBottom; btnBilgiKapat.Height = 50; btnBilgiKapat.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#22c55e'); btnBilgiKapat.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF'); btnBilgiKapat.clProSettings.FontSize = 16; btnBilgiKapat.clProSettings.IsRound = True; btnBilgiKapat.clProSettings.RoundHeight = 25; btnBilgiKapat.clProSettings.RoundWidth = 25; btnBilgiKapat.SetclProSettings(btnBilgiKapat.clProSettings); Form1.AddNewEvent(btnBilgiKapat, tbeOnClick, 'BilgiKapat');

  tmrCanta = Form1.AddNewTimer(Form1, 'tmrCanta', 1000); tmrCanta.Enabled = False; Form1.AddNewEvent(tmrCanta, tbeOnTimer, 'CantaSureGuncelle');

  MenuGoster;
  Form1.Run;
}


https://github.com/MustafaYigitDinc/assets" rel="nofollow - https://github.com/MustafaYigitDinc/assets
https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">



Cevaplar:
Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 04 Mayıs 2026 Saat 20:31
Merhaba Mustafa 
Ses eklediğin kodda aşağğıda kodda yer alan düzenlemeleri yapabilir misin

Clomosy üzerinde ses dosyalarını projenize eklemek için GitHub’ı uzak depolama alanı olarak kullanabilirsiniz. Bunun için öncelikle bir repository (örneğin assets) oluşturup (ya da var olan repository) içerisine .mp3 veya .wav uzantılı medya dosyanızı (örneğin ses2.mp3) yükleyin. Ardından bu dosyanın bağlantısını aşağıdaki formata uygun şekilde düzenleyin:

https://raw.githubusercontent.com/KULLANICI_ADI/REPO_ADI/BRANCH_ADI/DOSYA_ADI.mp3" rel="nofollow - https://raw.githubusercontent.com/KULLANICI_ADI/REPO_ADI/BRANCH_ADI/DOSYA_ADI.mp3

Örneğin:  https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3" rel="nofollow - https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3

Bu URL, uzantısı açık ve doğrudan erişilebilir olduğundan Clomosy tarafından sorunsuz şekilde indirilebilir. Proje kodunuzda bu bağlantıyı MyForm.AddAssetFromUrl(...) metodu ile çağırarak Clomosy proje dizinine aktarabilirsiniz. Daha sonra, örneğin MediaPlayer1.FileName = clPathCombine('ses2.mp3', Clomosy.AppFilesPath); satırı ile medya dosyasını kullanıma hazır hale getirebilirsiniz. Böylece GitHub üzerinden ses dosyaları Clomosy projelerinde kolayca oynatılabilir.

Örnek kod:


  var

   MyForm:TCLForm;

   MediaPlayer1 : TclMediaPlayer;

   Panel1 : TclPanel;

   Buton : TclButton;

   i : Integer;

   

  void trigger; 

  var

    clickedBtn:TClButton;

  {

    clickedBtn = TClButton(MyForm.Clsender); 

    if (clickedBtn.Hint == '0')

    {

      MediaPlayer1.CurrentTime = 0;

      MediaPlayer1.Play;

    }else

    {

       MediaPlayer1.Stop;

       MediaPlayer1.Volume = 1;

    }

  }

  

  {

  MyForm = TCLForm.Create(Self);

  MyForm.AddAssetFromUrl(' https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3" rel="nofollow - https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3 '); 

  

  MediaPlayer1 = TclMediaPlayer.Create(MyForm);

  MediaPlayer1.FileName = clPathCombine('ses2.mp3',Clomosy.AppFilesPath);

  

  Panel1 = MyForm.AddNewPanel(MyForm,'Panel1');

  Panel1.Align = alCenter;

  Panel1.Width = MyForm.clWidth / 2;

  Panel1.Height = MyForm.clHeight / 6;

  

  for (i = 0 to 1)

  {

    if(i == 0)

    {

      Buton = MyForm.AddNewButton(Panel1,'Buton'+IntToStr(i), 'Start');

      Buton.Align = AlLeft;

    }else

    {

      Buton = MyForm.AddNewButton(Panel1,'Buton'+IntToStr(i), 'Stop'); 

      Buton.Align = AlRight;

    }

    Buton.width = Panel1.width / 2;

    Buton.Hint = IntToStr(i);

    MyForm.AddNewEvent(Buton,tbeOnClick,'trigger');

  }

  MyForm.Run;

}


NOT: Yukarıdaki url adresi örnektir. Kendi yapınızı oluşturunuz. Kodu çalıştırdığınızda örnek url den dolayı hata alırsınız.

< defer="" ="https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" -cf-beacon=""version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"_timing":"name":"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true,"location_startswith":null" crossorigin="anonymous">


Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 04 Mayıs 2026 Saat 20:32
dikkat etmen gerekir satır burası 

Örneğin:  https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3" rel="nofollow - https://raw.githubusercontent.com/ornekKullanici/assets/main/ses2.mp3 < defer="" ="https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" -cf-beacon=""version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"_timing":"name":"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true,"location_startswith":null" crossorigin="anonymous">



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net