Skip to content

A python remake of the famous T-Rex game from Google chrome

License

Notifications You must be signed in to change notification settings

turing-usp/chrome-trex-rush

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

T-Rex Rush

trex game screenshot

trex game gif

Description

A recreated version of the famous Chrome T-Rex in Python.

Technology

Built using pygame library

Version and Release

First Release, version 1.0

Target Platforms

Windows/Linux

Instructions and Prerequisites

To run this game:

  • Make sure you have Python installed alongwith pygame (http://www.pygame.org/) library

  • Install the chrome_trex package:

    git clone https://github.com/GrupoTuringCodes/chrome-trex-rush
    cd chrome-trex-rush
    pip install .
  • Use the package:

    from chrome_trex import DinoGame, ACTION_UP, ACTION_FORWARD, ACTION_DOWN
    
    # Create a new game that runs with at most 'fps' frames per second.
    # Use fps=0 for unlimited fps.
    game = DinoGame(fps)
    
    # Go to the next frame and take the action 'action'
    # (ACTION_UP, ACTION_FORWARD or ACTION_DOWN).
    game.step(action)
    
    # Get a list of floats representing the game state
    # (positions of the obstacles and game speed).
    game.get_state()
    
    # Get the game score.
    game.get_score()
    
    # Reset the game.
    game.reset()
    
    # Close the game.
    game.close()
  • To run multiple players at the same time:

    from chrome_trex import MultiDinoGame, ACTION_UP, ACTION_FORWARD, ACTION_DOWN
    
    # Create a new game that runs with at most 'fps' frames per second.
    # Use fps=0 for unlimited fps.
    game = MultiDinoGame(fps)
    
    # Go to the next frame and make each player take the corresponding
    # action in  'action_list'
    # (ACTION_UP, ACTION_FORWARD or ACTION_DOWN).
    game.step(action_list)
    
    # Get a list of floats representing the game state
    # (positions of the obstacles and game speed).
    game.get_state()
    
    # Get a list with the score of each score of each player.
    game.get_scores()
    
    # Reset the game.
    game.reset()
    
    # Close the game.
    game.close()

Developers

Initially developed by: Shivam Shekhar (shivam.shekhar.ece14@itbhu.ac.in)

Adapted by:

Credits

About

A python remake of the famous T-Rex game from Google chrome

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%