Piano Tiles – Week 2 (Python)

In this week we started working on the basic requirements, of our project. That was to generate tiles randomly on the top of screen and then make them fall. We also had to increase the speed of the falling tiles as our score increases.

For our first part, generate random tiles on screen, we used randint from random lib. We initiated 6 different variables and then called randint(min,max) in them, to get random numbers from 0 to 3. The reason why we choose 0 to 3 was because we set our screen width so that only 4 tiles could fit in. We can change this random from 0 to 4, or to any other number, but then we will have to increase our screen width too.

To increase the speed of our falling tiles, with score, we simply defined a speedy variable to change the speed and incremented it in a while loop.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s