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

Other input devices #8

Open
wants to merge 20 commits into
base: master
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/
UrsinaAchievements/
highscore/
157 changes: 0 additions & 157 deletions UrsinaAchievements/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions UrsinaAchievements/achievements.json

This file was deleted.

Binary file removed UrsinaAchievements/confetti.png
Binary file not shown.
Binary file added assets/unifont-15.0.01.otf
Binary file not shown.
14 changes: 8 additions & 6 deletions car.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def __init__(self, position = (0, 0, 4), rotation = (0, 0, 0), topspeed = 30, ac
self.rotation_parent = Entity()

# Controls
self.controls = "wasd"
self.controls = ["w", "a", "s", "d"]
self.hand_brake_control = "space"
self.respawn_control = "g"

# Car's values
self.speed = 0
Expand Down Expand Up @@ -524,10 +526,10 @@ def update(self):
self.particle_time = 0
self.particles = Particles(self, self.particle_pivot.world_position - (0, 1, 0))
self.particles.destroy(1)

# TrailRenderer / Skid Marks
if self.graphics != "ultra fast":
if self.drift_speed <= self.min_drift_speed + 2 and self.start_trail:
if self.drift_speed <= self.min_drift_speed + 2 and self.start_trail:
if self.pivot_rotation_distance > 60 or self.pivot_rotation_distance < -60 and self.speed > 10:
for trail in self.trails:
trail.start_trail()
Expand Down Expand Up @@ -559,7 +561,7 @@ def update(self):
self.camera_rotation += self.friction * 20 * time.dt

# Braking
if held_keys[self.controls[2] or held_keys["down arrow"]]:
if held_keys[self.controls[2]] or held_keys["down arrow"]:
self.speed -= self.braking_strenth * time.dt
self.drift_speed -= 20 * time.dt
self.braking = True
Expand Down Expand Up @@ -593,7 +595,7 @@ def update(self):
self.skid_sound.stop(False)

# Hand Braking
if held_keys["space"]:
if held_keys[self.hand_brake_control]:
if self.rotation_speed < 0:
self.rotation_speed -= 3 * time.dt
elif self.rotation_speed > 0:
Expand Down Expand Up @@ -663,7 +665,7 @@ def update(self):
self.rotation_speed = -self.max_rotation_speed

# Respawn
if held_keys["g"]:
if held_keys[self.respawn_control]:
self.reset_car()

# Reset the car's position if y value is less than -100
Expand Down
26 changes: 0 additions & 26 deletions highscore/highscore.json

This file was deleted.

85 changes: 0 additions & 85 deletions highscore/unlocked.json

This file was deleted.

1 change: 0 additions & 1 deletion highscore/username.txt

This file was deleted.

Loading