Basketball Game

Dear Readers,

As always, I have to check that you are all doing well, and are okay - clearly we are in troubling times right now, but I am sending love and prayers to all of you reading this. It is well :)

As I mentioned in my last post, today is a post for the coders. I put up a poll on my instagram to ask whether people would want to see my project or something new in the works. The people spoke - I answered. So I have a couple slides talking about my project is and how I developed it.

As a precursor, I will describe the inspiration behind this game. I have a younger brother, Victor, who loves gaming and any ball related sport - I simply decided to fuse the two. His birthday was around the corner, and with the state of my bank balance (we don't need to talk about it) I knew I wasn't going to be able to splash out on the PS4 he wanted desperately. And then it occurred to me  - sis, I can code! Let me make him something - that's what engineers do!

I won't do too much rambling because the slides themselves are lengthy and you can read through them yourself. I have opted to  not screen shot my code, due to protection of my intellectual property, but I have put the pseudo-code in the slides, so you have a very clear idea of how the project was developed. Eventually, it will end up as one of a few games in my Gamekid device - the handheld gaming console that I am developing. I found a really cute case, with buttons and a monitor that works off of the Raspberry Pi Microprocessors, that was also not too expensive, so I should be looking to buy that very soon! But more on that another time.


Enjoy the slides! And don't miss my note at the very bottom.
(please note, you can click on an image to enlarge it)


This is a video of me playing the game (rather poorly, might I add, I've never been great at shooting my shot somebody laugh at my joke)




 I'm going to explain the above slide briefly. PYTHON IDLE is the integrated development environment that I used to code. I coded this project using the language python, and I normally enjoy using IDLE as the environment (yes I know there are better ones, let me be old school). The things listed under PYTHON IDLE are the modules that you will need to run the code. Modules are libraries of code that store pre-written functions, that make the coding experience so much easier, since you aren't having to essentially "reinvent the wheel" when there's a simple one line code of code that does it for you. The modules I used were pygame (used to make games, this does not come with python, so you have to install it to python using a tool called pip, for more on that watch this: installing pip ) Random (generates random numbers, comes with python), time(used for all things time related, also comes with python) and math (you guessed it - used for maths and ALSO comes with python)
Enough rambling - lets get back.

I appreciate that for anyone who hasn't coded, this may be a lot. But try to understand it. I have some slides coming up that help.




The project makes use of the concept of projectile motion, i.e. how an object moves when you throw it. If you were to trace its motion on a graph, where x was its horizontal motion and the y was its vertical displacement, you would see it shaped like a parabola (x squared graph with a negative coefficient, or an upside down x squared graph) Rather than me poorly explain why this is, I will link you to this.


And if you've reached the end, stay tuned for the next post. I have something really exciting coming up, and an opportunity for some of you. So keep on the look out!

Stay nourished, hydrated, healthy, and indoors!
EO

Comments

Popular Posts