GithubHelp home page GithubHelp logo

turtle-crossing's Introduction

Crossy Road with Turtle Graphics

capture

The Game

This code uses various instances of the Turtle class to create different objects. The player.py class is the main turtle, whose commands are listened by the Screen() object, waiting for key strokes of "Up","Down","Left" and "Right" to move the turtle a fixed step in the given direction.

car_manager.py holds instances of car objects that are generated inside the road gaps every 7 ticks so long the game is running. They are moved a set pace, until there is an increment in their velocity after the turtle reaches the finish line. The score is held by the scoreboard.py class, which in turn is another instance of the Turtle class, responsible for keeping track of the score on the screen, as well as writing "GAME OVER" once the game finishes.

Installation on Local Machine

  1. Clone the repository:

    shell$ git clone https://github.com/ghubnerr/turtle-crossing

  2. Navigate to the project directory:

    cd turtle-crossing

  3. Run the code:

    python turtle-crossing

Alternatively, download the .zip file and execute step 3 at the desired directory.

Requirements:

  • Git (for cloning)
  • Python 3.x

License:

This project is licensed under the MIT License.

Acknowledgements

Inspirational credit for Dr. Angela Yu and her 100 Days of Code in Python for Udemy.

turtle-crossing's People

Contributors

ghubnerr 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.