-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
719 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
# RacingGame | ||
# Instructions: | ||
|
||
**explenation of code:** | ||
- username input has validation | ||
- select different sponsors in menu and you get a different car depending on sponsor. | ||
- npc car follow predetermined path and each time you win the npc car gets faster | ||
- there is 10 levels and if you win all 10 then you win | ||
|
||
find these lines in the code and then explain in doc. you can un-comment it and then play the game and ss the result. when screenshotting code remove most of the comments and keep only important ones | ||
|
||
this shows the mask(hitbox) of the cars: | ||
|
||
```python | ||
#WIN.blit(self.mask.to_surface(), self.mask_rect.topleft) | ||
``` | ||
\ | ||
this shows the mask(hitbox) of the track border and finish: | ||
|
||
```python | ||
#WIN.blit(TRACK_BORDER_MASK.to_surface(), (track_border_x, track_border_y)) | ||
#WIN.blit(FINISH_MASK.to_surface(), FINISH_POSITION) | ||
``` | ||
\ | ||
displaying the npc path points: | ||
```python | ||
# def draw_points(self, win): | ||
# for point in self.path: | ||
# pygame.draw.circle(win, (255, 0, 0), point, 5) | ||
|
||
# def draw(self, win): | ||
# super().draw(win) | ||
# self.draw_points(win) | ||
|
||
# if event.type == pygame.MOUSEBUTTONDOWN: | ||
# pos = pygame.mouse.get_pos() | ||
# computer_car.path.append(pos) | ||
|
||
#print(computer_car.path) | ||
``` | ||
make sure to click on the screen and then press any button on keyboard to display the path points |
Oops, something went wrong.