Code Sketch


bisleri
By: Mhalsakant School

// --- Kojo Vector Art: Bisleri Water Bottle Refreshing Ad Animation ---
cleari()
setBackground(Color(240, 250, 255)) // ???? ???? ????? ??????????

// ?. ?????????? ???? ??? ??????? (Water Waves & Bubbles Background)
def drawWaterBackground(time: Double): Unit = {
  // ???? ??????? ?????????? ???
  val aura = Picture.circle(140)
  aura.setFillColor(Color(180, 235, 255, 120))
  aura.setPenColor(noColor)
  aura.setPosition(0, 0)
  draw(aura)

  // ???????? ??????? (Bubbles)
  for (i <- 0 until 8) {
    val bubbleY = (-120 + ((time * 2 + i * 40) % 260)) - 20
    val bubbleX = Math.sin(time * 0.05 + i) * 80
    val bubble = Picture.circle(4 + (i % 3) * 2)
    bubble.setFillColor(Color(255, 255, 255, 160))
    bubble.setPenColor(Color(0, 180, 220, 100))
    bubble.setPosition(bubbleX, bubbleY)
    draw(bubble)
  }
}

// ?. ?????????? ???????? ???? (Realistic Bisleri Bottle Structure)
def drawBisleriBottle(): Unit = {
  // ?. ??? (Bisleri Green Cap)
  val cap = Picture.rect(24, 16)
  cap.setFillColor(Color(0, 155, 115)) // ???????? ???????? ?????
  cap.setPenColor(noColor)
  cap.setPosition(-12, 75)
  draw(cap)

  // ?. ?????? ??? (Bottle Neck)
  val neck = Picture.fromVertexShape { p =>
    p.beginShape()
    p.vertex(-10, 75)
    p.vertex(10, 75)
    p.vertex(20, 45)
    p.vertex(-20, 45)
    p.endShape()
  }
  neck.setFillColor(Color(210, 240, 255, 200)) // ??????????? ?????????
  neck.setPenColor(Color(160, 210, 235))
  draw(neck)

  // ?. ?????? ????? ???? (Main Bottle Body)
  val body = Picture.rect(56, 115)
  body.setFillColor(Color(210, 240, 255, 180))
  body.setPenColor(Color(150, 205, 230))
  body.setPenThickness(2)
  body.setPosition(-28, -70)
  draw(body)

  // ?. ???????? ????? ???? (Bisleri Signature Green Label)
  val label = Picture.rect(56, 45)
  label.setFillColor(Color(0, 155, 115)) // Bisleri Green Color
  label.setPenColor(noColor)
  label.setPosition(-28, -25)
  draw(label)

  // ?. ???????? "Bisleri" ???
  val brandName = Picture.text("Bisleri", 13)
  brandName.setPenColor(Color(255, 255, 255)) // ?????? ????? ?????
  brandName.setPosition(-22, -10)
  draw(brandName)

  val subText = Picture.text("with minerals", 6)
  subText.setPenColor(Color(255, 230, 150))
  subText.setPosition(-18, -20)
  draw(subText)

  // ?. ???????? ?????????? ???????? ?????? (Water Level & Reflection)
  val waterLine = Picture.line(40, 0)
  waterLine.setPenColor(Color(255, 255, 255, 180))
  waterLine.setPenThickness(3)
  waterLine.setPosition(-20, 25)
  draw(waterLine)
}

// ?. ?????????? ??????? ??? ??????? (Ad Tagline Text)
def drawAdText(frame: Double): Unit = {
  // ????? ???????
  val mainTitle = Picture.text("HAR PAANI KI BOOND MEIN", 13)
  mainTitle.setPenColor(Color(0, 110, 80))
  mainTitle.setPosition(-95, 135)
  draw(mainTitle)

  val brandTitle = Picture.text("BISLERI!", 22)
  brandTitle.setPenColor(Color(0, 155, 115))
  brandTitle.setPosition(-50, 105)
  draw(brandTitle)

  // ???????? "Camel / Water / Bisleri" ???? ?????
  if (frame > 30) {
    val camelAd = Picture.text("#SamajhdarPiteHain", 10)
    camelAd.setPenColor(Color(0, 120, 180))
    camelAd.setPosition(-55, -115)
    draw(camelAd)
  }
}

// ?. ??????? ?????????? ??????? (Animation Engine Loop)
animateWithState(0.0) { t =>
  erasePictures()

  drawWaterBackground(t)  // ?. ???????? ???????? ???????
  drawBisleriBottle()     // ?. ???????? ????
  drawAdText(t)           // ?. ???? ??????? ??? ?????

  t + 1.0
}