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

adding y coordinate and speed features #62

Open
wants to merge 3 commits into
base: bug-beatles
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
2 changes: 1 addition & 1 deletion bug-beatles/Password_generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="app-name">Password Generator</h1>
<div class="display-container">
<input type="text" readonly placeholder="Password" class="display" data-password-display>

<button class="copy-btn" data-copy-btn>
<button class="copy-btn" data-copy-btn onclick="myFunction()">
<p data-copy-msg class="copy-tooltip"></p>
<img src="./images/copy.svg" alt="copy" class="copy-img">
</button>
Expand Down
2 changes: 1 addition & 1 deletion bug-beatles/modern_chair/chair.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="info-wrap mob-margin">
<p class="title-up">Modern chair</p>
<h2>Telford Kursi</h2>
<h4>$254 <span>$530</span></h4>
<h4>$260 <span>$530</span></h4>
<div class="section-fluid">
<input class="desc-btn" type="radio" id="desc-1" name="desc-btn" checked />
<label for="desc-1">Description</label>
Expand Down
6 changes: 3 additions & 3 deletions bug-beatles/modern_chair/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ label.color-2 {
opacity: 1;
}
.back-color.chair-3 {
background-image: linear-gradient(196deg, #8a9fb2, #5f7991);
background-image: linear-gradient(196deg, rgb(74, 74, 74), #6b6d6e);
opacity: 0;
}
.for-color-3:checked ~ .back-color.chair-3 {
Expand Down Expand Up @@ -380,10 +380,10 @@ h5 {
background-color: #333;
}
.for-color-2:checked ~ .info-wrap .btn:before {
background-color: #1a1a1a;
background-color: rgba(143, 130, 130, 0.673);
}
.for-color-3:checked ~ .info-wrap .btn:before {
background-color: #40566e;
background-color: black;
}
.for-color-4:checked ~ .info-wrap .btn:before {
background-color: #5e89b2;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions bug-beatles/python-turtle-crossing/cars.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# cars.py
from turtle import Turtle
import random
COLORS = ['blue', 'red', 'yellow', 'purple', 'green']

COLORS = ['blue', 'red', 'yellow', 'purple', 'green']

class Cars(Turtle):

def __init__(self):
super().__init__()
self.x_move = 10
def _init_(self, speed):
super()._init_()
self.x_move = speed # Initialize the speed of the cars
self.color(random.choice(COLORS))
self.shape("square")
self.shapesize(1, 2)
self.penup()
self.goto(280, random.randint(-230, 250))

def move(self):
self.goto(self.xcor()-self.x_move, self.ycor())


self.goto(self.xcor()-self.x_move, self.ycor())
18 changes: 14 additions & 4 deletions bug-beatles/python-turtle-crossing/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
scoreboard = Scoreboard()
screen.setup(width=600, height=600)


screen.update()

game_is_on = True
all_cars = []
counter = 0
screen.listen()
finish_line_y = 280
car_speed = 10

screen.listen()
screen.onkeypress(player.up, "Up")

while game_is_on:
if counter % 3 == 0:
car = Cars()
car = Cars(car_speed)
all_cars.append(car)

counter += 1
Expand All @@ -34,7 +35,16 @@
break
car.move()

if player.ycor() > finish_line_y:
for car in all_cars:
car.clear() # Clear the car from the screen
car.hideturtle() # Hide the car turtle
all_cars.clear() # Clear the list of cars
player.goto(0, -270)
scoreboard.update_level()
car_speed += 2

time.sleep(0.1)
screen.update()

screen.exitonclick()
screen.exitonclick()
6 changes: 3 additions & 3 deletions bug-beatles/python-turtle-crossing/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

class Player(Turtle):

def __init__(self):
super().__init__()
def _init_(self):
super()._init_()
self.penup()
self.shape("turtle")
self.goto(0, -270)
self.setheading(90)

def up(self):
self.forward(20)
self.forward(20)