Skip to content
This repository was archived by the owner on Feb 13, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
311db0a
Update Alphaproj.py
t3bol90 Feb 24, 2019
179257b
Update createTurtles.py
t3bol90 Feb 24, 2019
754c60f
Create .gitignore
W4S4P34 Feb 26, 2019
cc5555b
.pyc incoming!
W4S4P34 Feb 26, 2019
b8ee895
Merge branch 't3bol90-patch-1-1'
W4S4P34 Feb 26, 2019
a798acc
Merge branch 'TurtleProjv1.2'
W4S4P34 Feb 26, 2019
ba18a67
Revert "Merge branch 'TurtleProjv1.2'"
W4S4P34 Feb 26, 2019
e7f60a1
Revert "Revert "Merge branch 'TurtleProjv1.2'""
W4S4P34 Feb 26, 2019
0d943d7
.pyc again!
W4S4P34 Mar 1, 2019
e7af461
Merge branch 'modify'
W4S4P34 Mar 1, 2019
5f0c918
New Version!
W4S4P34 Mar 1, 2019
a1e1dc2
Change!
W4S4P34 Mar 1, 2019
cd1d9eb
Merge remote-tracking branch 'upstream/master' into modify
W4S4P34 Mar 1, 2019
9585ec8
Ranking!
W4S4P34 Mar 1, 2019
02cbf4d
Ranking!
W4S4P34 Mar 2, 2019
3400c60
Merge pull request #7 from lathanhthai1905/modify
t3bol90 Mar 2, 2019
bdc8a12
Add files via upload
t3bol90 Mar 3, 2019
e04464a
:>
W4S4P34 Mar 4, 2019
aed3b7b
BugFixed50% :alien:
W4S4P34 Mar 4, 2019
2a8881b
Merge pull request #9 from lathanhthai1905/modify-bugfixed
t3bol90 Mar 4, 2019
6415d2f
Design incoming :>
W4S4P34 Mar 4, 2019
30677f8
Change!
W4S4P34 Mar 5, 2019
ddd5a0a
Commit thử
W4S4P34 Mar 5, 2019
aa79289
Revert "Change!"
W4S4P34 Mar 5, 2019
2d91e44
Revert "Revert "Change!""
W4S4P34 Mar 5, 2019
6659e72
:<
W4S4P34 Mar 5, 2019
e93d285
:<
W4S4P34 Mar 5, 2019
7b5fe3f
Merge remote-tracking branch 'upstream/master' into modify-bugfixed
W4S4P34 Mar 6, 2019
803ac42
GUI
W4S4P34 Mar 6, 2019
c7d4c57
GUI Safer but not Smooth at all!
W4S4P34 Mar 6, 2019
c903045
Arghhh!
W4S4P34 Mar 7, 2019
9aab304
Merge pull request #13 from lathanhthai1905/TurtleProjv1.4
t3bol90 Mar 7, 2019
488f84a
Update randomTurtles.py
t3bol90 Mar 7, 2019
7a094bb
Sth
W4S4P34 Mar 7, 2019
37b8ba5
:-1:
W4S4P34 Mar 7, 2019
9869128
Fix bug x 3,14
W4S4P34 Mar 7, 2019
7046cbf
:>
W4S4P34 Mar 7, 2019
490f40e
Images
W4S4P34 Mar 9, 2019
4d5dce7
FuckThisShjtI'mOut
W4S4P34 Mar 10, 2019
d6137d4
:<Thisgonetoofar
W4S4P34 Mar 10, 2019
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.pyc
9 changes: 0 additions & 9 deletions Alphaproj.py

This file was deleted.

Binary file modified construct/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified construct/__pycache__/createRoad.cpython-37.pyc
Binary file not shown.
Binary file modified construct/__pycache__/createTurtles.cpython-37.pyc
Binary file not shown.
Binary file modified construct/__pycache__/randomTurtles.cpython-37.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions construct/constructWorld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import time
from construct import createRoad, createTurtles, randomTurtles,createRanking
from tkinter import *

def createtheWorld(length):
createRoad.create(length + 1)
t = createTurtles.create(length + 1)
time.sleep(1)
time_r = randomTurtles.makeItMove(t, length + 1)
createRanking.create(time_r, t)

122 changes: 68 additions & 54 deletions construct/createRanking.py
Original file line number Diff line number Diff line change
@@ -1,57 +1,71 @@
from turtle import *

from tkinter import *
from construct import rewardRanking
import time

def create(timeindex, tur):
# Clear drawer's line and pen-it-up
clear ()
pu ()
# Clear turtles' lines
for i in range (4):
tur[timeindex[2 * i]].clear ()
# Penup turtles
for i in range (4):
tur[timeindex[2 * i]].pu ()
# Hide turtles
for i in range (4):
tur[timeindex[2 * i]].ht ()
# Draw the ranking
ht ()
y = 100
setpos (-220, y)
pd ()
for i in range (3):
forward (480)
pu ()
y -= 100
goto (-220, y)
pd ()
pu ()
x = -220
setpos (x, 100)
pd ()
right (90)
forward (200)
for i in range (4):
pu ()
x += 120
goto (x, 100)
pd ()
forward (200)
# Write something :v
pu ()
goto (-280, 40)
write ("Turtle", move=False, align="center", font=("Arial", 15, "normal"))
goto (-280, -60)
write ("Time", move=False, align="center", font=("Arial", 15, "normal"))
# Turtle's rank
x = -160
for i in range (4):
tur[timeindex[2 * i]].goto (x, 50)
tur[timeindex[2 * i]].left (90)
x += 120
tur[timeindex[2 * i]].st ()
x = -165
for i in range (4):
goto (x, -55)
x += 120
write (("%0.2f" % timeindex[2 * i + 1]), move=False, align="center", font=("Arial", 10, "bold"))
# Clear drawer's line and pen-it-up
cv = getcanvas()
screen = getscreen()
Bgphoto = PhotoImage(file = "images/race/BGTurtleBlack.gif", master = cv)
cv.create_image(-360, -300, image = Bgphoto, anchor = N+W)
cv.image = Bgphoto
clear ()
pu ()
# Clear turtles' lines
for i in range (4):
tur[timeindex[2 * i]].clear ()
# Penup turtles
for i in range (4):
tur[timeindex[2 * i]].pu ()
# Hide turtles
for i in range (4):
tur[timeindex[2 * i]].ht ()
#Medals
cv.create_text(0, -180, text = "RECORD", font = ("Fipps",18,"italic"), fill = "#ffffff")
# Draw the ranking
ht ()
y = 100
setpos (-220, y)
pd ()
for i in range (3):
forward (480)
pu ()
y -= 100
goto (-220, y)
pd ()
pu ()
x = -220
setpos (x, 100)
pd ()
right (90)
forward (200)
for i in range (4):
pu ()
x += 120
goto (x, 100)
pd ()
forward (200)
# Write something :v
pu ()
goto (-280, 40)
write ("Turtle", move=False, align="center", font=("Fipps", 15, "normal"))
goto (-280, -60)
write ("Time", move=False, align="center", font=("Fipps", 15, "normal"))
# Turtle's rank
x = -160
for i in range (4):
tur[timeindex[2 * i]].goto (x, 50)
tur[timeindex[2 * i]].left (90)
x += 120
tur[timeindex[2 * i]].st ()
x = -165
for i in range (4):
goto (x, -55)
x += 120
write (("%0.2f" % timeindex[2 * i + 1]), move=False, align="center", font=("Arial", 10, "bold"))
#Continue
# cv.create_text(150, 250, text = "Press 'space' to continue...", font = ("Fipps",10,"italic"), fill = "#ffffff")
# screen.onkeypress(rewardRanking.reward,"space")
# screen.listen()

74 changes: 35 additions & 39 deletions construct/createRoad.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
from turtle import *
from tkinter import *
from construct.createTurtles import gencolor


#Create road's length buttons
def makeshort(n):
n = int(10)
def makelong(n):
n = int(20)
def makemedium(n):
n = int(15)


#Create road of course
def create():
speed(0)
penup()
goto(-140,140) #Set the default position
n = 0
bgcolor("white")
# onkey(makeshort(n),"U")
# onkey(makelong(n),"O")
# onkey(makemedium(n),"I")
# listen()

screensize(480, 360)

n = int(textinput("Noti from Pornhub ", "Please enter the length of the road: "))
n = n + 1
#Draw lines of the road
for step in range(n):
write(step, align = 'center')
right(90)
#Draw dashed lines
for step in range (15):
forward(10)
if (step % 2 == 0): penup()
else: pendown()
#Start drawing the next line
penup()
backward(150)
left(90)
forward(20)
return n
def create(n):
cv = getcanvas()
cv.delete("all")
screen = getscreen()
title("Turtle Racing Boiz")
Bgphoto = PhotoImage(file = "images/race/BGTurtle.gif", master = cv)
cv.create_image(-360, -300, image = Bgphoto, anchor = N+W)
cv.image = Bgphoto
speed(0)
penup()
color("white")
bgcolor("black")
#Set the default position
if (n == 13):
startPos = -120
elif (n == 17):
startPos = -160
elif(n == 21):
startPos = -200
goto(startPos, 40)
#Draw lines of the road
for step in range(n):
write(step, align = 'center')
right(90)
#Draw dashed lines
for step in range (15):
forward(10)
if (step % 2 == 0): penup()
else: pendown()
#Start drawing the next line
penup()
backward(150)
left(90)
forward(20)
63 changes: 35 additions & 28 deletions construct/createTurtles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,41 @@

#Generate colours of turtles
def gencolor():
r = lambda: randint(0, 255)
return ('#%02X%02X%02X' % (r(), r(), r()))
r = lambda: randint(0, 255)
return ('#%02X%02X%02X' % (r(), r(), r()))


#Create turtles absolutely
def create():
x, y, spin = -150, 100, 0 #Set the default coordinates
tur = []

for n in (gencolor(),gencolor(),gencolor(),gencolor()): #Create the turtles
#Customize the turtles
t = Turtle()
t.color(n)
t.shape('turtle')

#Move turtles to the start point
t.penup()
t.goto(x,y)
t.pendown()
y -= 30

#Spin each turtle
spin += 1
if (spin % 2 == 0):
t.right(360)
else:
t.left(360)

tur.append(t)

return tur #Return the list of turtles
def create(n):
#Set the default coordinates
if (n == 13):
x, y, spin = -130, 0, 0
elif (n == 17):
x, y, spin = -170, 0, 0
elif (n == 21):
x, y, spin = -210, 0, 0

tur = []

for n in (gencolor(),gencolor(),gencolor(),gencolor()): #Create the turtles
#Customize the turtles
t = Turtle()
t.color(n)
t.shape('turtle')

#Move turtles to the start point
t.penup()
t.goto(x,y)
t.pendown()
y -= 30

#Spin each turtle
spin += 1
if (spin % 2 == 0):
t.right(360)
else:
t.left(360)

tur.append(t)

return tur #Return the list of turtles
Loading