

{"id":85087,"date":"2021-01-07T18:33:46","date_gmt":"2021-01-07T13:03:46","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=85087"},"modified":"2026-06-01T12:53:42","modified_gmt":"2026-06-01T07:23:42","slug":"fruit-ninja-game-python","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/","title":{"rendered":"Create Fruit Ninja Game in Python &#8211; Cut the Delicious Fruits"},"content":{"rendered":"<p>Fruit ninja game, also known as fruit-slicing game which is easy to play. Fruit ninja game is popular among children.<\/p>\n<p>The objective of this project is to build a fruit ninja game with python. This game is built with the help of pygame module and basic concept of python.<\/p>\n<p>In this game, the user has to cut the fruits by touching the mouse on fruits. There are also bombs with fruits. If the mouse touches more than three bombs then the game will be over.<\/p>\n<h3>Project Prerequisites<\/h3>\n<p>In this python project, we require pygame, random, sys, and os module of python. Please install pygame and random:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install pygame\r\nPip install random\r\n<\/pre>\n<h3>Download Fruit Ninja Game Python Code<\/h3>\n<p>Please download source code of fruit ninja python project: <a href=\"https:\/\/drive.google.com\/file\/d\/1BNjdfjz7qwG8d-qCUNgXvtBRUT0fo4XM\/view?usp=drive_link\"><strong>Fruit Ninja Python Source Code<\/strong><\/a><\/p>\n<h3>Project File Structure<\/h3>\n<p>These are the steps to build fruit ninja game :<\/p>\n<ul>\n<li>Importing required modules<\/li>\n<li>Initialize window<\/li>\n<li>Define functions<\/li>\n<li>Game loop<\/li>\n<\/ul>\n<p><strong>Let&#8217;s start building the fruit ninja game in python<\/strong><\/p>\n<h4>1. Importing required modules<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import pygame, sys\r\nimport os\r\nimport random\r\n<\/pre>\n<p>Start this project by importing libraries.<\/p>\n<h4>2. Creating display window<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">player_lives = 3\r\nscore = 0\r\nfruits = ['melon', 'orange', 'pomegranate', 'guava', 'bomb']\r\nWIDTH = 800\r\nHEIGHT = 500\r\nFPS = 12\r\n\r\npygame.init()\r\npygame.display.set_caption(\u2018FRUIT NINJA--DataFlair\u2019)\r\ngameDisplay = pygame.display.set_mode((WIDTH, HEIGHT))\r\nclock = pygame.time.Clock()\r\n\r\nWHITE = (255,255,255)\r\nBLACK = (0,0,0)\r\nRED = (255,0,0)\r\nGREEN = (0,255,0)\r\nBLUE = (0,0,255)\r\n\r\ngameDisplay.fill((BLACK))\r\nbackground = pygame.image.load('back.jpg')\r\nfont = pygame.font.Font(os.path.join(os.getcwd(), 'comic.ttf'), 32)\r\nscore_text = font.render('Score : ' + str(score), True, (255, 255, 255))\r\nlives_icon = pygame.image.load('images\/white_lives.png')\r\n<\/pre>\n<ul>\n<li><strong>player_lives<\/strong> will keep track of remaining lives<\/li>\n<li><strong>score<\/strong> will keeps track of score<\/li>\n<li><strong>fruits<\/strong> are the entities in the game<\/li>\n<li><strong>pygame.init()<\/strong> initialize pygame<\/li>\n<li><strong>pygame.display.set_caption<\/strong> will set the caption of game window<\/li>\n<li><strong>FPS<\/strong> controls how often the gameDisplay should refresh. In our case, it will refresh every 1\/12th second<\/li>\n<li><strong>WIDTH and HEIGHT<\/strong> are setting game display size by using pygame.display.set_mode<\/li>\n<li>game background set by<strong> pygame.image.load<\/strong> which is used to set image<\/li>\n<li><strong>Lives-icon<\/strong> stores images that show remaining lives<\/li>\n<\/ul>\n<h4>3. Generalized structure of the fruit Dictionary<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def generate_random_fruits(fruit):\r\n    fruit_path = \"images\/\" + fruit + \".png\"\r\n    data[fruit] = {\r\n        'img': pygame.image.load(fruit_path),\r\n        'x' : random.randint(100,500),               \r\n        'y' : 800,\r\n        'speed_x': random.randint(-10,10),    \r\n        'speed_y': random.randint(-80, -60),    \r\n        'throw': False,                       \r\n        't': 0,                               \r\n        'hit': False,\r\n    }\r\n\r\n    if random.random() &gt;= 0.75:     \r\n        data[fruit]['throw'] = True\r\n    else:\r\n        data[fruit]['throw'] = False\r\n\r\ndata = {}\r\nfor fruit in fruits:\r\n    generate_random_fruits(fruit)\r\n<\/pre>\n<ul>\n<li>This function generates random fruits and generalized structure<\/li>\n<li><strong>\u2018x\u2019<\/strong> and <strong>\u2018y\u2019<\/strong> store the value where the fruit should be positioned on x-coordinate and y &#8211; coordinate<\/li>\n<li><strong>Speed_x<\/strong> and <strong>speed_y<\/strong> are key that store the value of how fast the fruit should move in the x and y-direction. It also controls the diagonal movement of fruits<\/li>\n<li><strong>throws<\/strong> key used to determine that the generated coordinate of the fruits is outside the gameplay or not. If outside, then it will be discarded.<\/li>\n<li>Return the next random floating-point number in the range [0.0, 1.0) to keep the fruits inside the gameDisplay<\/li>\n<li>Data Dictionary used to hold the data of the random fruit generation<\/li>\n<\/ul>\n<h4>4. Method to draw fonts<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">font_name = pygame.font.match_font('comic.ttf')\r\n\r\ndef draw_text(display, text, size, x, y):\r\n    font = pygame.font.Font(font_name, size)\r\n    text_surface = font.render(text, True, WHITE)\r\n    text_rect = text_surface.get_rect()\r\n    text_rect.midtop = (x, y)\r\n    gameDisplay.blit(text_surface, text_rect)\r\n<\/pre>\n<ul>\n<li><strong>Draw_text<\/strong> function helps to draw text on the screen.<\/li>\n<li><strong>get_rect()<\/strong> return the Rect object.<\/li>\n<li><strong>X<\/strong> and <strong>y<\/strong> is the dimension of x-direction and y-direction<\/li>\n<li><strong>blit()<\/strong> draws image or writes text on the screen at a specified position<\/li>\n<\/ul>\n<h4>5. Draw players lives<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def draw_lives(display, x, y, lives, image) :\r\n    for i in range(lives) :\r\n        img = pygame.image.load(image)\r\n        img_rect = img.get_rect()      \r\n        img_rect.x = int(x + 35 * i)   \r\n        img_rect.y = y                 \r\n        display.blit(img, img_rect)\r\n\r\ndef hide_cross_lives(x, y):\r\n    gameDisplay.blit(pygame.image.load(\"images\/red_lives.png\"), (x, y))\r\n<\/pre>\n<ul>\n<li>img_rect gets the (x,y) coordinates of the cross icons (lives on the top rightmost side)<\/li>\n<li>img_rect .x sets the next cross icon 35 pixels from the previous one<\/li>\n<li>img_rect.y takes care of how many pixels the cross icon should be positioned from the top of the screen<\/li>\n<\/ul>\n<h4>6. Show game over display &amp; front display<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def show_gameover_screen():\r\n    gameDisplay.blit(background, (0,0))\r\n    draw_text(gameDisplay, \"FRUIT NINJA!\", 64, WIDTH \/ 2, HEIGHT \/ 4)\r\n    if not game_over :\r\n        draw_text(gameDisplay,\"Score : \" + str(score), 40, WIDTH \/ 2, 250)\r\n\r\n\r\n    draw_text(gameDisplay, \"Press a key to begin!\", 24, WIDTH \/ 2, HEIGHT * 3 \/ 4)\r\n    pygame.display.flip()\r\n    waiting = True\r\n    while waiting:\r\n        clock.tick(FPS)\r\n        for event in pygame.event.get():\r\n            if event.type == pygame.QUIT:\r\n                pygame.quit()\r\n            if event.type == pygame.KEYUP:\r\n                waiting = False\r\n<\/pre>\n<ul>\n<li><strong>show_gameover_screen()<\/strong> function shows the initial game screen and game over screen<\/li>\n<li><strong>pygame.display.flip()<\/strong> will update only a part of screen but if no args will pass then it will update the entire screen<\/li>\n<li><strong>pygame.event.get()<\/strong> will return all the event stored in the pygame event queue<\/li>\n<li>If event type is equal to quit then the pygame will quit<\/li>\n<li><strong>event.KEYUP<\/strong> event that occurs when the key is pressed and released<\/li>\n<\/ul>\n<h4>7. Game Loop<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">first_round = True\r\ngame_over = True        \r\ngame_running = True    \r\nwhile game_running :\r\n    if game_over :\r\n        if first_round :\r\n            show_gameover_screen()\r\n            first_round = False\r\n        game_over = False\r\n        player_lives = 3\r\n        draw_lives(gameDisplay, 690, 5, player_lives, 'images\/red_lives.png')\r\n        score = 0\r\n\r\n    for event in pygame.event.get():\r\n\r\n        if event.type == pygame.QUIT:\r\n            game_running = False\r\n\r\n    gameDisplay.blit(background, (0, 0))\r\n    gameDisplay.blit(score_text, (0, 0))\r\n    draw_lives(gameDisplay, 690, 5, player_lives, 'images\/red_lives.png')\r\n\r\n    for key, value in data.items():\r\n        if value['throw']:\r\n            value['x'] += value['speed_x']\r\n            value['y'] += value['speed_y']\r\n            value['speed_y'] += (1 * value['t'])\r\n            value['t'] += 1\r\n\r\n            if value['y'] &lt;= 800:\r\n                gameDisplay.blit(value['img'], (value['x'], value['y']))\r\n            else:\r\n                generate_random_fruits(key)\r\n\r\n            current_position = pygame.mouse.get_pos()\r\n\r\n            if not value['hit'] and current_position[0] &gt; value['x'] and current_position[0] &lt; value['x']+60 \\\r\n                    and current_position[1] &gt; value['y'] and current_position[1] &lt; value['y']+60:\r\n                if key == 'bomb':\r\n                    player_lives -= 1\r\n                    if player_lives == 0:\r\n                        hide_cross_lives(690, 15)\r\n                    elif player_lives == 1 :\r\n                        hide_cross_lives(725, 15)\r\n                    elif player_lives == 2 :\r\n                        hide_cross_lives(760, 15)\r\n                  \r\n                    if player_lives &lt; 0 :\r\n                        show_gameover_screen()\r\n                        game_over = True\r\n\r\n                    half_fruit_path = \"images\/explosion.png\"\r\n                else:\r\n                    half_fruit_path = \"images\/\" + \"half_\" + key + \".png\"\r\n\r\n                value['img'] = pygame.image.load(half_fruit_path)\r\n                value['speed_x'] += 10\r\n                if key != 'bomb' :\r\n                    score += 1\r\n                score_text = font.render('Score : ' + str(score), True, (255, 255, 255))\r\n                value['hit'] = True\r\n        else:\r\n            generate_random_fruits(key)\r\n\r\n    pygame.display.update()\r\n    clock.tick(FPS)\r\n\r\npygame.quit()\r\n<\/pre>\n<ul>\n<li>This is the mainloop of the game<\/li>\n<li>game_over terminates the game while loop if more than 3-Bombs are cut<\/li>\n<li>game_running used to manage the game loop<\/li>\n<li>If the event type is quit then the game window will be closed<\/li>\n<li>In this game loop we displaying the fruits inside the screen dynamically<\/li>\n<li>If a fruit is not cut then nothing will happen to it. if fruit cut, then a half-cut-fruit image should appear in place of that fruit<\/li>\n<li>if the user clicks bombs for three-time, a GAME OVER message should be displayed and the window should be reset<\/li>\n<li>clock.tick() will keep the loop running at the right speed (manages the frame\/second). The loop should update after every 1\/12th of the sec<\/li>\n<\/ul>\n<h3>Fruit Ninja Project Output<\/h3>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-85091\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output.png\" alt=\"fruit ninja game output\" width=\"1366\" height=\"729\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-300x160.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-1024x546.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-768x410.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-720x384.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-520x278.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-output-320x171.png 320w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/p>\n<h3>Project Summary<\/h3>\n<p>We have successfully created the fruit ninja game python project. We used the popular pygame library. We learned how to randomly generate fruits in particular positions. I hope you enjoyed building this game project.<\/p>\n<p><em>Disclaimer: Few of the images used in this project have been taken from Google, we do not hold the copyright of those images.<\/em><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2562,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1BNjdfjz7qwG8d-qCUNgXvtBRUT0fo4XM\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601072309\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1BNjdfjz7qwG8d-qCUNgXvtBRUT0fo4XM\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-01 08:15:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-04 13:06:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-08 00:17:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-11 16:43:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-15 02:23:56&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-15 02:23:56&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fruit ninja game, also known as fruit-slicing game which is easy to play. Fruit ninja game is popular among children. The objective of this project is to build a fruit ninja game with python.&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":85092,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[23694,21082,22734,21099],"class_list":["post-85087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-fruit-ninja-game","tag-python-project","tag-python-project-for-beginners","tag-python-project-with-source-code"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create Fruit Ninja Game in Python - Cut the Delicious Fruits - DataFlair<\/title>\n<meta name=\"description\" content=\"Fruit Ninja Game in Python - Create an interesting game in python with basic concepts like pygame, random, sys and os mudule\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Fruit Ninja Game in Python - Cut the Delicious Fruits - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Fruit Ninja Game in Python - Create an interesting game in python with basic concepts like pygame, random, sys and os mudule\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-07T13:03:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T07:23:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Fruit Ninja Game in Python - Cut the Delicious Fruits - DataFlair","description":"Fruit Ninja Game in Python - Create an interesting game in python with basic concepts like pygame, random, sys and os mudule","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:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/","og_locale":"en_US","og_type":"article","og_title":"Create Fruit Ninja Game in Python - Cut the Delicious Fruits - DataFlair","og_description":"Fruit Ninja Game in Python - Create an interesting game in python with basic concepts like pygame, random, sys and os mudule","og_url":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-01-07T13:03:46+00:00","article_modified_time":"2026-06-01T07:23:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"Create Fruit Ninja Game in Python &#8211; Cut the Delicious Fruits","datePublished":"2021-01-07T13:03:46+00:00","dateModified":"2026-06-01T07:23:42+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/"},"wordCount":750,"commentCount":12,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg","keywords":["fruit ninja game","Python project","python project for beginners","python project with source code"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/","url":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/","name":"Create Fruit Ninja Game in Python - Cut the Delicious Fruits - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg","datePublished":"2021-01-07T13:03:46+00:00","dateModified":"2026-06-01T07:23:42+00:00","description":"Fruit Ninja Game in Python - Create an interesting game in python with basic concepts like pygame, random, sys and os mudule","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/01\/fruit-ninja-game-in-python.jpg","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/fruit-ninja-game-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"Create Fruit Ninja Game in Python &#8211; Cut the Delicious Fruits"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/85087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=85087"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/85087\/revisions"}],"predecessor-version":[{"id":148641,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/85087\/revisions\/148641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/85092"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=85087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=85087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=85087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}