Inspiration
There are 2 things inspiring me to do this game the first is the video that I watched about animation in Tkinter, it looks amazing and I wanted to practice on it and make a project that has the same idea. In the middle of deep thinking, I saw a picture from a game that I used to play on my old Nokia phone it was about a girl try to bounce a ball and I who control it, so I found my idea here.
What it does
When you open the game, you will find the title on a nice background, and in the bottom 3 radio buttons with 3 players (Messi, Salah, Ronaldo), when you choose one of them the game window will appear and the ball dropped from the top right corner, you must move the player with (a, d) or (right, left) or drag by the mouse to the place where the ball will drop in before it reaches the ground (bounce it), when the ball touches the ground you lose and a splash screen come out with your score and 2 buttons (try again and exit)
How we built it
The first screen has 2 main components the background and the buttons, the background is a png image with some edits and the buttons are radio buttons to allow you to choose one player. The second screen is consists of the background above it the player and the ball, the ball move by while loop by increasing each position by a specific value each second but when it touches any surface it moves in the opposite direction and every time it touches the top surface of the player score increased by one and when it touches the ground it stops and the splash screen appears with the score and the two buttons.
Challenges we ran into
As I said the ball moving using the while loop, I use ''' while True: ''' to still moving until it touches the ground to get out of the while loop there is no way except ''' break ''' but all of the code inside the loop is function and break statement can't be used inside the function, so I started to search in every platform and every website until I found a line of code which terminate the program instantly. Also because I used functions there is a problem that images didn't appear, at the first, I have no idea why it's not working but after searching I found that when the image is inside a function there is one more line of code to add.
Accomplishments that we're proud of
It was my first good, usable, GUI, game desktop application, it means a lot to me and I really so proud especially when I play with it. Also, I build it from zero in just two days, considering that it is my first one I think this is a very good time.
What we learned
The splash screen that appears in the end, was an idea that comes to me after finished about 70% of the game and I don't know how to make it, after searching and learning about it I could make it. And I learned about a new library where I got the line of code that terminate the program. And how to add images inside functions.
What's next for UCL Bouncer
Maybe a small update changes the Messi and Ronaldo Shirts after the Mercato.
Built With
- python
- tkinter
Log in or sign up for Devpost to join the conversation.