Skip to main content

Posts

Showing posts with the label Python Games

Balloon Shooter Game using Python | Python Project | Simple Python Game | Vast Coding

Balloon Shooter Game using Python | Python Project | Simple Python Game | Vast Coding   " You can download the source code by the download button at the end of this page "    Here is the Source Code:- Balloon Shooter2.py import pygame import sys import random from math import * pygame.init() width = 720 height = 1200 display = pygame.display.set_mode((width, height)) pygame.display.set_caption("Balloon Shooter") clock = pygame.time.Clock() margin = 100 lowerBound = 100 score = 0 # Colors white = (230, 230, 230) lightBlue = (174, 214, 241) red = (231, 76, 60) lightGreen = (25, 111, 61) darkGray = (40, 55, 71) darkBlue = (21, 67, 96) green = (35, 155, 86) yellow = (244, 208, 63) blue = (46, 134, 193) purple = (155, 89, 182) orange = (243, 156, 18) font = pygame.font.SysFont("Snap ITC", 25) # Balloon Class class Balloon: def __init__(self, speed): self.a = random.randint(30, 40) self.b = self.a + random.randint(0, 10) self...

Carrom Board Game using Python | Simple Python Project | Vast Coding

Carrom Board Game using Python | Simple Python Project | Vast Coding   Here is the Source Code :- Note:- If you are facing any issues to copy the code,like:-"Failed to copy to the clipboard"  Then copy it in two or three parts.   import pygame, sys,math from pygame.locals import * from math import * pygame.init() screen = pygame.display.set_mode((600, 600)) background=(255,255,255) screen.fill(background) pygame.display.set_caption("Carrom") width=535 height=535 friction=0.2 border=65 mod = lambda v: sqrt(v[0] * v[0] + v[1] * v[1]) black=(0,0,0) player1_color=(40,40,40) player2_color=(180,180,180) white=(255,255,255) yellow=(255,255,0) pink=(255,20,147) def repaint(): pygame.draw.rect(screen,(0,0,0),Rect((40,40),(520,520))) pygame.draw.rect(screen,(230,210,140),Rect((65,65),(470,470))) pygame.draw.rect(screen,(0,0,0),Rect((180,140),(240,20))) pygame.draw.rect(screen,(230,210,140),Rect((185,145),(230,10))) pygame.draw.circle(screen,(139,0,0...

Flappy Bird Game using Python 🔥🔥 Python in Pydroid3 | Amazing Python Project | Vast Coding

Flappy Bird Game using Python 🔥🔥 Python in Pydroid3 | Amazing Python Project | Vast Coding                                    Here is the Source Code:- main.py import pygame import random from objects import Grumpy, Pipe, Base, Score # Setup ******************************************* pygame.init() SCREEN = WIDTH, HEIGHT = 288, 512 display_height = 0.80 * HEIGHT info = pygame.display.Info() width = info.current_w height = info.current_h if width >= height: win = pygame.display.set_mode(SCREEN, pygame.NOFRAME) else: win = pygame.display.set_mode(SCREEN, pygame.NOFRAME | pygame.SCALED | pygame.FULLSCREEN) # win = pygame.display.set_mode(SCREEN, pygame.SCALED | pygame.FULLSCREEN) clock = pygame.time.Clock() FPS = 60 # COLORS RED = (255, 0, 0) WHITE = (255, 255, 255) BLACK = (0, 0, 0) # Backgrounds bg1 = pygame.image.load('Assets/background-day.png') bg2 = pygame.image.load('Assets/b...

Snake Game | Simple Snake Game written in Python using the PyGame Library.

Snake Game | Simple Snake Game written in Python using the PyGame Library. Vast Coding   Here is the Source Code:- """ Snake Eater Made with PyGame """ import pygame, sys, time, random # Difficulty settings # Easy      ->  10 # Medium    ->  25 # Hard      ->  40 # Harder    ->  60 # Impossible->  120 difficulty = 25 # Window size frame_size_x = 720 frame_size_y = 480 # Checks for errors encountered check_errors = pygame.init() # pygame.init() example output -> (6, 0) # second number in tuple gives number of errors if check_errors[1] > 0:     print(f'[!] Had {check_errors[1]} errors when initialising game, exiting...')     sys.exit(-1) else:     print('[+] Game successfully initialised') # Initialise game window pygame.display.set_caption('Snake Eater') game_window = pygame.display.set_mode((frame_size_x, frame_size_y)) # Colors (R, G, B) black = pygame.Colo...