{"id":995,"date":"2023-05-13T13:18:13","date_gmt":"2023-05-13T04:18:13","guid":{"rendered":"https:\/\/tippang.net\/?page_id=995"},"modified":"2023-05-13T13:28:04","modified_gmt":"2023-05-13T04:28:04","slug":"balloonpop","status":"publish","type":"page","link":"https:\/\/tippang.net\/?page_id=995","title":{"rendered":"BalloonPop"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>the player clicks on balloons that appear on the screen, and each successful click will increment the score<\/p>\n\n\n\n<p><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Balloon Pop<\/title>\n  <style>\n    canvas {\n      display: block;\n      margin: 0 auto;\n      background-color: skyblue;\n    }\n  <\/style>\n<\/head>\n<body>\n  <canvas id=\"gameCanvas\" width=\"800\" height=\"400\"><\/canvas>\n  <script>\n    \nconst canvas = document.getElementById(\"gameCanvas\");\nconst ctx = canvas.getContext(\"2d\");\n\nlet balloons = [];\nlet score = 0;\n\nclass Balloon {\n  constructor() {\n    this.x = Math.random() * canvas.width;\n    this.y = canvas.height;\n    this.speed = Math.random() * 3 + 1;\n    this.radius = Math.random() * 20 + 10;\n    this.color = `hsl(${Math.random() * 360}, 100%, 50%)`;\n  }\n\n  draw() {\n    ctx.beginPath();\n    ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2);\n    ctx.fillStyle = this.color;\n    ctx.fill();\n    ctx.closePath();\n  }\n\n  update() {\n    this.y -= this.speed;\n  }\n}\n\nfunction addBalloon() {\n  balloons.push(new Balloon());\n  setTimeout(addBalloon, Math.random() * 2000);\n}\n\nfunction drawScore() {\n  ctx.font = \"24px Arial\";\n  ctx.fillStyle = \"black\";\n  ctx.fillText(`Score: ${score}`, 10, 30);\n}\n\nfunction gameLoop() {\n  ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n  for (const balloon of balloons) {\n    balloon.update();\n    balloon.draw();\n  }\n\n  drawScore();\n  requestAnimationFrame(gameLoop);\n}\n\ncanvas.addEventListener(\"click\", (e) => {\n  const mouseX = e.clientX - canvas.getBoundingClientRect().left;\n  const mouseY = e.clientY - canvas.getBoundingClientRect().top;\n\n  balloons = balloons.filter((balloon) => {\n    const distance = Math.hypot(balloon.x - mouseX, balloon.y - mouseY);\n\n    if (distance < balloon.radius) {\n      score++;\n      return false;\n    }\n\n    return true;\n  });\n});\n\naddBalloon();\ngameLoop();\n\n\n\n\n\n  <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>the player clicks on balloons that appear on the screen, and each successful click will<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"footnotes":""},"class_list":["post-995","page","type-page","status-publish","hentry"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>BalloonPop - tippang.net<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tippang.net\/?page_id=995\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:locale\" content=\"en_US\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:type\" content=\"article\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:title\" content=\"BalloonPop - tippang.net\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:description\" content=\"the player clicks on balloons that appear on the screen, and each successful click will\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tippang.net\/?page_id=995\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"og:site_name\" content=\"tippang.net\" class=\"yoast-seo-meta-tag\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-13T04:28:04+00:00\" class=\"yoast-seo-meta-tag\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" class=\"yoast-seo-meta-tag\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tippang.net\/?page_id=995\",\"url\":\"https:\/\/tippang.net\/?page_id=995\",\"name\":\"BalloonPop - tippang.net\",\"isPartOf\":{\"@id\":\"https:\/\/tippang.net\/#website\"},\"datePublished\":\"2023-05-13T04:18:13+00:00\",\"dateModified\":\"2023-05-13T04:28:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/tippang.net\/?page_id=995#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tippang.net\/?page_id=995\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tippang.net\/?page_id=995#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tippang.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"BalloonPop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tippang.net\/#website\",\"url\":\"https:\/\/tippang.net\/\",\"name\":\"tippang.net\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/tippang.net\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tippang.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/tippang.net\/#organization\",\"name\":\"tippang.net\",\"url\":\"https:\/\/tippang.net\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tippang.net\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/tippang.net\/wp-content\/uploads\/2021\/02\/cropped-\u110e\u1162\u1102\u1165\u11af\u110b\u1161\u110b\u1175\u110f\u1169\u11ab1_\u1100\u1165\u1107\u116e\u11a8\u110b\u1175.png\",\"contentUrl\":\"https:\/\/tippang.net\/wp-content\/uploads\/2021\/02\/cropped-\u110e\u1162\u1102\u1165\u11af\u110b\u1161\u110b\u1175\u110f\u1169\u11ab1_\u1100\u1165\u1107\u116e\u11a8\u110b\u1175.png\",\"width\":280,\"height\":280,\"caption\":\"tippang.net\"},\"image\":{\"@id\":\"https:\/\/tippang.net\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"BalloonPop - tippang.net","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tippang.net\/?page_id=995","og_locale":"en_US","og_type":"article","og_title":"BalloonPop - tippang.net","og_description":"the player clicks on balloons that appear on the screen, and each successful click will","og_url":"https:\/\/tippang.net\/?page_id=995","og_site_name":"tippang.net","article_modified_time":"2023-05-13T04:28:04+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tippang.net\/?page_id=995","url":"https:\/\/tippang.net\/?page_id=995","name":"BalloonPop - tippang.net","isPartOf":{"@id":"https:\/\/tippang.net\/#website"},"datePublished":"2023-05-13T04:18:13+00:00","dateModified":"2023-05-13T04:28:04+00:00","breadcrumb":{"@id":"https:\/\/tippang.net\/?page_id=995#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tippang.net\/?page_id=995"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tippang.net\/?page_id=995#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tippang.net\/"},{"@type":"ListItem","position":2,"name":"BalloonPop"}]},{"@type":"WebSite","@id":"https:\/\/tippang.net\/#website","url":"https:\/\/tippang.net\/","name":"tippang.net","description":"","publisher":{"@id":"https:\/\/tippang.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tippang.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tippang.net\/#organization","name":"tippang.net","url":"https:\/\/tippang.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tippang.net\/#\/schema\/logo\/image\/","url":"https:\/\/tippang.net\/wp-content\/uploads\/2021\/02\/cropped-\u110e\u1162\u1102\u1165\u11af\u110b\u1161\u110b\u1175\u110f\u1169\u11ab1_\u1100\u1165\u1107\u116e\u11a8\u110b\u1175.png","contentUrl":"https:\/\/tippang.net\/wp-content\/uploads\/2021\/02\/cropped-\u110e\u1162\u1102\u1165\u11af\u110b\u1161\u110b\u1175\u110f\u1169\u11ab1_\u1100\u1165\u1107\u116e\u11a8\u110b\u1175.png","width":280,"height":280,"caption":"tippang.net"},"image":{"@id":"https:\/\/tippang.net\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/pages\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tippang.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=995"}],"version-history":[{"count":2,"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/pages\/995\/revisions"}],"predecessor-version":[{"id":1011,"href":"https:\/\/tippang.net\/index.php?rest_route=\/wp\/v2\/pages\/995\/revisions\/1011"}],"wp:attachment":[{"href":"https:\/\/tippang.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}