Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Python game into PyGamesScripts #1092

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions EthicalHackingScripts/Family Key Logger/key_logger.py

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions PyGamesScripts/Koala Speed Clicker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Koala Speed Clicker Game
Koala Speed Clicker is a game developed in Python Programming Language using threading, turtle, and glob modules.

## Aim
The aim of the project is to create a simple clicking game using Python Graphic Turtle Module.

## Purpose
The purpose of this project is to give the user a gaming experience of playing speed clicking games.

## About the game
* It is a single player game.
* The more clicks user has, the more points user obtains.

## How to play?
* The user has to spam click the Koala image directly using the mouse button within 5 seconds after compiling the game.
* After 5 seconds, the total clicks or score will be shown and determine if the user clicks fast enough.
* After that, user can exit by clicking the screen.

## Setup instructions
1. Install Python 3.x from https://www.python.org/downloads/
2. Install any Python IDE that is preferred (PyCharm is recommended).
3. Download this repository as zip and extract.

## Compilation Steps
1. Open the extracted folder through the IDE.
2. Debug and Run your code
3. Have Fun!

## Output
![](Images/output1.png)
![](Images/output2.png)
![](Images/output3.png)
![](Images/output4.png)

## Author
Name of author : [Jessica Clarita](https://github.com/jessicaclarita)
68 changes: 68 additions & 0 deletions PyGamesScripts/Koala Speed Clicker/koala_speed_clicker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Koala Speed Clicker

import turtle
from threading import Timer
import glob

# set up the screen
t = turtle.Screen()
t.setup(1000, 589)

# import images from Images folder
images = glob.glob('Images/*.gif')

# set title and background picture
t.title("Speed Clicker Game")
t.bgpic(images[0])

# insert image
t.register_shape(images[1])
koala = turtle.Turtle()
koala.shape(images[1])
koala.speed(0)

# set up the pen or text
pen = turtle.Turtle()
pen.hideturtle()
pen.color("white")
pen.penup()
pen.goto(0, -250)
pen.write(f"Spam click the koala within 5 seconds", align="center", font=("Comic Sans MS", 30, "bold"))

# create a placeholder for number of clicks
clicks = 0


# function to increment the number of clicks
def clicked(x, y):
global clicks
clicks += 1
pen.clear()
pen.write(f"Koala clicks: {clicks}", align="center", font=("Comic Sans MS", 30, "bold"))


# function to display the total of clicks
def finish():
global clicks
koala.speed(0)
pen.clear()
if clicks >= 10:
pen.write(f"Wow, so fast! Total click(s): {clicks}\n Click to Exit", align="center",
font=("Comic Sans MS", 30, "bold"))
t.onscreenclick(end)

elif clicks < 10:
pen.write(f"Oof, too slow! Total click(s): {clicks}\n Click to Exit", align="center",
font=("Comic Sans MS", 30, "bold"))
t.onscreenclick(end)


# function to exit or quit the program
def end(x, y):
quit()


koala.onclick(clicked) # on click listener
s = Timer(5.0, finish) # set timer to 5 seconds
s.start() # start the timer
t.mainloop() # loop or keep the GUI window
3 changes: 3 additions & 0 deletions PyGamesScripts/Koala Speed Clicker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import turtle
from threading import Timer
import glob