Giter Club home page Giter Club logo

python-snake-game's Introduction

Python-Snake-Game

This is a Snake Game created using Python with storage of Game Data in MYSQL Database using pymysql. It is a snake game consisting of a snake of characters, the snake initially is a '#' character and as it collects food(which are * characters)these characters are appended to the snake's body which makes it longer.You can direct the snake in different directions using the arrow keys.You get 10 points per food collected.If the snake hits a wall or heads into its own tail then the game will be over.As more and more food is collected the length and the speed of the snake increases thereby making the game harder.There are 3 difficulty levels in the game.Player scores are stored in MySql database. Tkinter is used for creating the GUI. pymysql is used for Database Access/Manipulation. pygame.mixer module is used for some fancy sounds on different events during the game like for game over,collecting food and background music. The food is spawned randomly anywhere on the canvas and the code handles conditions where the spawned food and the snakes body overlaps to avoid erroneus spawning of food. The bind function is used to bind the game window to the keyboard input for arrow keys inorder to create events on use of the arrow keys and execute the respective functions when any of the arrow keys is pressed. The Sound files can be changed or removed completely as per your preference.:)

python-snake-game's People

Contributors

roystonfurtado avatar

Stargazers

 avatar  avatar

Watchers

 avatar

python-snake-game's Issues

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.