Don't Collide

BADGE COLLECTED: DON'T COLLIDE

DON'T COLLIDE (7/17/2023):

For this lesson, we needed to create a game in which the player needs to get through the obstacles without hitting them and if they do hit them, the game ends. I took the liberty to import car images to create a car chase game. I also included other things not mentioned in the lesson such as asking the user if they want to play again, instead of just ending automatically. The instructions for this lesson were complicated and it was a little tough to follow through, there was lots of debugging involved, and there are definitely things that need to be improved such as creating a game that allows the obstacles to be randomly placed instead of in the same place.

Additional Resources (Optional)

For my game, I incorporated this additional piece of code that might be helpful for students who want to make a game in which if the user collides, with the object, they are asked if they want to play again. For that, you need to know how to get input from the user and some functions like '.lower()' might help, so I incorporated a website for it, if anyone wants to use it.

elif level == 0:

    answer = input("Do you want to play again? Y for Yes, N for No: ")

    if answer.lower() == "y":

    # Reset the game and start again

      level = 1

      score = 0

    elif answer.lower() == "n":

      print("Thanks for playing!")

    else:

      print("Invalid input. Please enter a valid input.")

This is a good website to learn more about the randint() function and help students learn how to make a game that creates random obstacles per frame and not something repetitive and predictable.