GithubHelp home page GithubHelp logo

shiva-karthick / py_games Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.6 MB

Random Pygame games

Python 100.00%
pygame brick pygame-crash-course game snake-game python3 python projects pong-game bricks car-racing car-racing-game bricksbreaker-game

py_games's Introduction

Games tutorial with pygame

Dependencies

  • Python 3.6 and above
  • pygame module
Windows : pip install pygame

Racing

Racing

Bricks

Bricks

Pygame crash course

Welcome to a quick pygame crash course. Firstly, Install pygame.

Windows : pip install pygame

The below code shows a basic framework that is included in every pygame.

import pygame
from pygame.locals import *
import os
import sys
import math
import random

pygame.init()
fpsClock = pygame.time.Clock()
pygame.display.set_caption('Flappy Bird')
main_surface = pygame.display.set_mode((800, 600))
BLACK = pygame.Color(0, 0, 0)

# initialise all things here


while True:
    main_surface.blit()

    # draw something


    # draw something


    # draw something

    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

    # main game logic

    pygame.display.update()  # pygame.display.flip()
    clock.tick(60) # 60 frames

pygame.quit()
quit()

py_games's People

Contributors

shiva-karthick avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.