Code Sketch


Bixuu02_annabelle story part-01
By: Mhalsakant School
Category: Programming
//> using platform jvm
//> using jvm 17

import javax.swing._
import javax.swing.event._
import java.awt._
import java.awt.event._

object AnnabelleHorrorApp {

  def main(args: Array[String]): Unit = {

    SwingUtilities.invokeLater(new Runnable {
      def run(): Unit = {

        // 1. SECURITY VERIFICATION
        val correctPassword = "Bixuu02_anime"
        val userInput = JOptionPane.showInputDialog(
          null,
          "? HORROR SECURITY VERIFICATION\n\nPlease enter Password to access Annabelle Horror App:",
          "Haunted Access",
          JOptionPane.QUESTION_MESSAGE
        )

        if (userInput == null || userInput != correctPassword) {
          JOptionPane.showMessageDialog(
            null,
            "? Access Denied! Incorrect Password.",
            "Error",
            JOptionPane.ERROR_MESSAGE
          )
          sys.exit(0)
        }

        // 2. HORROR STORY DATA (20 CHAPTERS / EPISODES)
        val storyData: Map[String, String] = Map(
          "Chapter 1: The Antique Shop" ->
            """==================================================
              |HORROR STORY: ANNABELLE - THE CURSE OF THE RAGDOLL
              |Written by Bixuu
              |==================================================
              |
              |HORROR CHARACTERS:
              | - David (Protagonist / Husband)
              | - Sarah (Wife / Expecting Mother)
              | - Father Thomas (Exorcist Priest)
              | - Annabelle (The Haunted Porcelain Doll)
              |
              |CHAPTER 1 STORY & DIALOGUES:
              |David ne ek purane antique store se apni pregnant wife Sarah ke liye ek vintage ragdoll kharidi, jiska naam Annabelle tha. Unhe nahi pata tha ki yeh doll apne sath ek demonic shraap laa rahi hai.
              |
              |Sarah: "David, yeh doll thodi creepy nahi lag rahi? Iski aankhon mein kuch ajeeb sa hai."
              |David: "Pagal mat bano, Sarah. Tumhare baby room ke liye yeh perfect vintage piece hai."
              |Sarah (Darrte hue): "Thik hai... par mujhe isse ajeeb si thandak mehsoos ho rahi hai."
              |===================================================""".stripMargin,

          "Chapter 2: The First Midnight Whispers" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 2 STORY & DIALOGUES:
              |Pehli hi raat ghar mein ajeeb aawazein aane lagiin. Living room se kisi ke chalne ki aawaz aa rahi thi.
              |
              |David (Neend se uthte hue): "Kaun hai wahan? Sarah, kya tum ho?"
              |*Living room mein jakar dekhta hai toh Annabelle doll apne glass case se bahar chair par baithi hoti hai.*
              |David: "Yeh doll yahan kaise aayi? Maine toh ise display case mein rakha tha..."
              |Sarah (Peeche se aakar): "David... mujhe dar lag raha hai. Is doll ko bahar fenk do!"
              |===================================================""".stripMargin,

          "Chapter 3: The Moving Doll" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 3 STORY & DIALOGUES:
              |Agli subah David ne doll ko dustbin mein fenk diya, par jab woh shaam ko wapas ghar aaya toh doll wapas kitchen counter par rakhi thi.
              |
              |David (Shocked): "Yeh kaise mumkin hai?! Maine toh ise garbage mein dala tha!"
              |Sarah: "Humara ghar safe nahi hai, David! Kuch toh iske andar hai jo humara peechha nahi chhod raha!"
              |David: "Shayad koi prank kar raha hai. Hum isse police ko ya kisi expert ko dikhate hain."
              |===================================================""".stripMargin,

          "Chapter 4: The Paranormal Investigator" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 4 STORY & DIALOGUES:
              |Ek paranormal expert ne ghar visit kiya aur doll ko dekhte hi uske hosh ud gaye.
              |
              |Investigator (Trembling): "Yeh koi aam doll nahi hai. Iske andar ek powerful demonic entity trapped hai jo kisi innocent ki soul ko capture karna chahti hai."
              |Sarah (Crying): "Toh hume kya karna chahiye?!"
              |Investigator: "Turant is ghar ko khali karo aur ek exorcist ko bulao!"
              |===================================================""".stripMargin,

          "Chapter 5: Unexplained Shadows" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 5 STORY & DIALOGUES:
              |Ghar chhodne se pehle hi raat ko lights achanak gul ho gayiin aur walls par creepy shadows dikhne lagiin.
              |
              |Sarah: "David! Lights on karo! Mujhe andhere se darr lag raha hai!"
              |Voice from Shadow (Whispering): "She is mine... The baby is mine..."
              |David: "Kaun hai wahan?! Samne aao!"
              |*Doll ka sir achanak 180 degrees ghum jata hai aur ek bhyankar cheekh goonj uthti hai.*
              |===================================================""".stripMargin,

          "Chapter 6: Entering the Church" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 6 STORY & DIALOGUES:
              |David aur Sarah doll ko ek local church mein Father Thomas ke paas le kar pahunche.
              |
              |Father Thomas (Holy water chhidkate hue): "In the name of God, is vastu se door raho! Isme shaitaan ki taqatein bastee hain."
              |David: "Father, please ispe prayer perform kijiye. Isne hamari zindagiyo ko nark bana diya hai."
              |Father Thomas: "Yeh aasan nahi hoga beta. Shaitaan bahut taqatwar ho chuka hai."
              |===================================================""".stripMargin,

          "Chapter 7: The Demonic Attack" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 7 STORY & DIALOGUES:
              |Church ke room mein achanak hawa mein thandi lehar daud gayi aur cross ulta latakne laga.
              |
              |Annabelle (Creepy demonic voice): "Tum mujhe nahi rok sakte... Yeh ghar aur yeh baccha mera hai!"
              |Sarah (Pet mein dard se chilate hue): "Ahhh! David, mujhe bachao!"
              |Father Thomas: "Hold the cross tightly! Shaitaan ke aage mat jhuko!"
              |===================================================""".stripMargin,

          "Chapter 8: The Secret History of the Doll" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 8 STORY & DIALOGUES:
              |Father Thomas ne purane church records check kiye aur pata chalaya ki is doll ko ek black magic cult ne curse kiya tha.
              |
              |Father Thomas: "Kai saal pehle, ek satanic cult ne is doll ke zariye ek aatma ko summon kiya tha. Jab tak yeh doll destroy nahi hogi, yeh shraap chalta rahega."
              |David: "Toh ise jala kyu nahi dete?"
              |Father Thomas: "Aag ispe asar nahi karegi. Iske liye ek special ritual ki zaroorat hai."
              |===================================================""".stripMargin,

          "Chapter 9: The Ghostly Hallucinations" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 9 STORY & DIALOGUES:
              |Ghar wapas aane ke baad David ko hallucination hone lagi ki Sarah badal chuki hai aur uski aankhein black ho chuki hain.
              |
              |David (Panic mein): "Sarah... tumhari ankhon ko kya hua hai?!"
              |Sarah (Strange voice mein): "David, kya main tumhari achhi wife nahi hoon?"
              |David: "Nahi! Tum Sarah nahi ho! Door raho mujhse!"
              |*Achanak illusion toot jata hai aur Sarah normal bed par behosh milti hai.*
              |===================================================""".stripMargin,

          "Chapter 10: The Midnight Sickness" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 10 STORY & DIALOGUES:
              |Sarah ki tabiyat raat-raat bhar kharab hone lagi. Doctors kuch samajh nahi pa rahe the.
              |
              |Doctor: "Mr. David, humari medical reports normal hain, par phir bhi inki body energy tezi se gir rahi hai."
              |David: "Yeh kisi bimaari ki wajah se nahi, kisi shraap ki wajah se ho raha hai!"
              |Father Thomas (Phone par): "David, waqt kam hai. Aaj raat hume ritual pura karna hoga."
              |===================================================""".stripMargin,

          "Chapter 11: The Blood Moon Eclipse" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 11 STORY & DIALOGUES:
              |Aasmaan mein khooni chand (Blood Moon) nikla tha. Shaitaan ki shaktiyan apne peak par thin.
              |
              |Father Thomas: "Aaj ki raat sabse khatarnak hai. Shaitaan doll ke zariye physical world mein aane ki koshish karega."
              |David: "Main apni family ko bachane ke liye apni jaan bhi dene ke liye taiyar hoon."
              |Annabelle (Doll ki ankhon se khoon nikalte hue): "Your soul will be mine, David..."
              |===================================================""".stripMargin,

          "Chapter 12: Trapped in the Basement" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 12 STORY & DIALOGUES:
              |Ghar ka basement achanak apne aap lock ho gaya aur charo taraf se ajeeb chiqein aane lagiin.
              |
              |David: "Darwaza khul kyu nahi raha?! Father Thomas, hum trap ho chuke hain!"
              |Father Thomas: "Yeh demonic barrier hai. Pray karte raho, rasta khud ban jayega."
              |*Basement ki deewaron se khoon tapakne lagta hai.*
              |===================================================""".stripMargin,

          "Chapter 13: The Summoning Circle" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 13 STORY & DIALOGUES:
              |Basement ke beechon-beech ek dark circle ban gaya jiske center mein Annabelle doll khadi thi.
              |
              |Annabelle: "Tum sab yahan marne ke liye aaye ho!"
              |Father Thomas (Latin mein prayers padhte hue): "Exorcizo te, omnis immunde spiritus!"
              |*Doll hawa mein uth jati hai aur tezi se cheezein idhar-udhar fenkne lagti hai.*
              |===================================================""".stripMargin,

          "Chapter 14: The Final Stand" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 14 STORY & DIALOGUES:
              |David ne apni jaan ki baazi lagakar aage badh kar doll ke haathon mein holy crucifix pakda diya.
              |
              |David: "Meri family ko chhod do, shaitaan! Tumhara yahan koi adhikar nahi hai!"
              |Annabelle (Screaming in agony): "Ahhhhh! Yeh dard... tum mujhe nahi hara sakte!"
              |Father Thomas: "Now David! Holy water ki bottle doll ke upar daal do!"
              |===================================================""".stripMargin,

          "Chapter 15: The Demonic Scream" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 15 STORY & DIALOGUES:
              |Jaise hi Holy Water doll par pada, poore ghar mein ek bhyankar dhamaka hua aur shaitaan ki aawaz goonji.
              |
              |Demonic Voice: "Main wapas aaunga... yeh ant nahi hai!"
              |*Doll zameen par gir padti hai aur uski aakhon ki chamak gayab ho jati hai.*
              |Sarah (Hosh mein aate hue): "David... kya sab kuch khatam ho gaya?"
              |===================================================""".stripMargin,

          "Chapter 16: Securing the Evil" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 16 STORY & DIALOGUES:
              |Father Thomas ne doll ko ek sacred wooden box mein band karke uspe special seals laga diin.
              |
              |Father Thomas: "Ise ab kabhi kholna mat. Hum ise church ke secret museum mein lock kar denge jahan yeh kisi ko nuksan na pahuncha sake."
              |David: "Shukr hai ki sab kuch theek ho gaya. Meri family bach gayi."
              |===================================================""".stripMargin,

          "Chapter 17: Peace Returns Home" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 17 STORY & DIALOGUES:
              |Kuch dino baad Sarah ne ek healthy baby ko ???? diya. Ghar mein khushiyan wapas laut aayin.
              |
              |Sarah: "Humne is nightmare ko peechhe chhod diya hai, David."
              |David: "Haan, ab humari life bilkul normal hogi."
              |*Lekin unhe nahi pata tha ki church ke museum mein band box ke andar se abhi bhi scratching ki aawaz aa rahi thi.*
              |===================================================""".stripMargin,

          "Chapter 18: The Warning Bell" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 18 STORY & DIALOGUES:
              |Church ke museum mein, jahan Annabelle ko rakha gaya tha, wahan achanak security alarm bajne laga.
              |
              |Security Guard: "Yeh ajeeb baat hai, museum ka lock andar se kaise khul gaya?"
              |*Guard jab box ke paas jata hai, toh box ka glass halka sa crack milta hai.*
              |===================================================""".stripMargin,

          "Chapter 19: The Doll Never Sleeps" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 19 STORY & DIALOGUES:
              |Guard jab paas jakar dekhta hai, toh Annabelle doll ki ankhon mein ek halka sa red glow dikhta hai.
              |
              |Annabelle (Whispering in the dark): "I am waiting for you..."
              |Guard (Terrified): "Nahi... yeh kaise ho sakta hai?!"
              |*Screen dark ho jati hai aur background mein creepy hansi goonjti hai.*
              |===================================================""".stripMargin,

          "Chapter 20: The Ultimate Warning - Epilogue" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |
              |CHAPTER 20 STORY & DIALOGUES (HORROR ENDING):
              |Ek warning note screen par flash hota hai.
              |
              |Author's Warning Note:
              | "Kuch cheezein aisi hoti hain jinhe kabhi jagana nahi chahiye. Annabelle abhi bhi wahi hai... aur kisi naye shikaar ke intezaar mein hai!"
              |
              |THE END - HORROR STORY WRITTEN BY BIXUU.
              |==================================================
              |
              |? ANNOUNCEMENT FROM CREATOR BIXUU:
              |"BIXUU (??????) PRESENTED THIS TERRIFYING HORROR STORY FOR YOU! 
              |Hope you got chills. Please Wait for Part 2 of Annabelle!"
              |===================================================""".stripMargin
        )

        // 3. GUI WINDOW CREATION
        val frame = new JFrame("Horror Story Viewer: ANNABELLE - By Bixuu")
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
        frame.setSize(950, 650)
        frame.setLocationRelativeTo(null)

        // Header (Dark Horror Theme Color - Dark Red/Black)
        val headerLabel = new JLabel("  ? HORROR STORY: ANNABELLE - THE CURSE OF THE RAGDOLL (Written by Bixuu)  ", SwingConstants.CENTER)
        headerLabel.setFont(new Font("Arial", Font.BOLD, 15))
        headerLabel.setOpaque(true)
        headerLabel.setBackground(new Color(60, 0, 0))
        headerLabel.setForeground(Color.WHITE)
        headerLabel.setPreferredSize(new Dimension(950, 40))

        // Chapter List
        val chapterKeys = (1 to 20).map(i => storyData.keys.find(_.startsWith(s"Chapter $i:")).getOrElse(s"Chapter $i")).toArray
        val listModel = new DefaultListModel[String]()
        chapterKeys.foreach(listModel.addElement)

        val chapterList = new JList[String](listModel)
        chapterList.setFont(new Font("Arial", Font.PLAIN, 12))
        chapterList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
        chapterList.setSelectedIndex(0)

        val listScrollPane = new JScrollPane(chapterList)
        listScrollPane.setPreferredSize(new Dimension(320, 500))

        // Story Text Area (Dark spooky background feel)
        val storyArea = new JTextArea()
        storyArea.setFont(new Font("Monospaced", Font.PLAIN, 13))
        storyArea.setEditable(false)
        storyArea.setLineWrap(true)
        storyArea.setWrapStyleWord(true)
        storyArea.setBackground(new Color(20, 20, 20))
        storyArea.setForeground(new Color(230, 230, 230))
        storyArea.setText(storyData(chapterKeys(0)))
        storyArea.setCaretPosition(0)

        val textScrollPane = new JScrollPane(storyArea)

        // Selection Listener
        chapterList.addListSelectionListener(new ListSelectionListener {
          def valueChanged(e: ListSelectionEvent): Unit = {
            if (!e.getValueIsAdjusting) {
              val selectedKey = chapterList.getSelectedValue
              if (selectedKey != null && storyData.contains(selectedKey)) {
                storyArea.setText(storyData(selectedKey))
                storyArea.setCaretPosition(0)
              }
            }
          }
        })

        // Layout Assembly
        val mainPanel = new JPanel(new BorderLayout())
        mainPanel.add(headerLabel, BorderLayout.NORTH)
        mainPanel.add(listScrollPane, BorderLayout.WEST)
        mainPanel.add(textScrollPane, BorderLayout.CENTER)

        frame.add(mainPanel)
        frame.setVisible(true)
      }
    })
  }
}

// Direct Execution Entrypoint for Scala Script / REPL
AnnabelleHorrorApp.main(Array())