Friday, 1 April 2016

Flappy Bird Scratch Task

Content:

- Computational thinking (understanding the logic of the codes)

- Creation of own Flappy Bird game using sprites, backgrounds and sounds provided

- Creation of own sprites, modifications to game etc.

Process:

For this task, the teachers introduced us to Scratch, a game programming program. What first caught my interest in Scratch was the way the coding was carried out. Instead of the conventional typing in lines of codes, Scratch codes are actually put into individual blocks. The blocks then can be dragged onto the script of an individual sprite and connected to other blocks, eventually forming a string of code for that particular sprite. A string of connected blocks of code is shown in the image below:

 This string of code is actually made up of 4 blocks of code. As we can see, it is much more convenient and easy to use this than to type lines of codes. These blocks are all already provided and only dragging and dropping of the codes in the correct order is needed. Less debugging needs to be done as there is no sytax that must be followed in this case.

Eventually, I also enjoyed using scratch as it had a user-friendly interface that was easy to understand and interact with. Each element of the game, such as the characters and the pipe in this case, is known as a sprite in Scratch. Upon creation of each sprite, the sprites will be placed on a toolbar as shown:

As we can see, the sprites are organised very clearly in the toolbar and it is easy to select the sprites by just clicking on it in the toolbar. In the picture, we can see that the pipe is selected. Upon selection of an individual sprite, 3 more tabs will appear, namely the script, costumes and sound. The script is the place where the strings of code as seen above are located at and the codes in the string of the particular sprite only runs for that sprite individually. The costumes tab includes several costumes of the sprite. This can be used to help us create an animation effect such as the flapping of the wings or randomise the appeareance of costumes such as that of the pipe. The costumes of the sprite is also controlled by the blocks of code found in the script of that sprite. As for the sound tab, sound clips for the sprite can be included and controlled in the script.

With the instructions given by the teachers and the easy-to-use interface of Scratch, I was able to quite easily complete the initial task of replicating the Flappy Bird game. Then, Mr Zhou challenged us to modify and improve the game on our own. This was slightly harder as it meant that we had to  be creative, and had to be able to transform our intended outcome into strings of working code. I also adjusted with the magnitude of the boost function and the acceleration of gravity to ensure a smoother gameplay. Some of the modifications I added include the switching of Flappy bird to Pacman and back at several time intervals, moving clouds from the right to the left of the screen, and synchronising the time so that the score would be added as the character passes the pipe instead of as the pipe is deleted.

For the Pacman, I added two extra images: one of Pacman with mouth open and one with Pacman with his mouth closed as the costumes to the Flapppy Bird sprite. After a set amount of time, the Flappy Bird will be replaced by the Pacman. Just like the Flappy Bird will have its wings show the illusion of flapping, the Pacman will have its mouth opening and closing repeatedly.

For the cloud, I created a new sprite, and ran a set of codes similar to that of the pipe. The cloud which is hidden outside the screen would be repeatedly cloned and the clones would move from the right to the left, deleted at the end.


Reflection:
Apart from the convenience offered by Scratch, the blocks-of-code system in Scratch also allows us to better understand code logic and improve our computational thinking. For the strings of codes to run right, the blocks of codes must be put in the right order, which requires computational thinking and an understanding of code logic. Deep thought and close attention must also be given to certain strings of codes that will run interactions between sprites. As the sprites are coded individually, messages must be sent and received between sprites for the intended outcome to occur. This will require us to code logically and meticulously to avoid mistakes. For a beginner, I feel that Scratch is definitely a good programme for learning. The neat,easy-to-use interface and the block coding system will aid the beginner in maintaining his or her own project well. It will also develop skills in the beginner while allow them to bypass more complications along the way such as wrong use of syntax which may hinder their learning.

Personal Development:

Prior to this task, I have also personally embarked on a Stencyl game project on my own. Stencyl is another game programming tool that is similar to Scratch. The sprites have seperate scripts, sounds etc, just like Scratch. The codes are also in blocks that will be connected, similar to Scratch. Personally I prefer Scratch as I feel that the interface of Scratch is still neater than that of Stencyl. However, having used Stencyl definitely helped me pick up Scratch more easily and hence I was able to complete the task rather quickly. Not just did this task help me learn alot, I also enjoyed the process as well. From here, I would try to embark on several 2D game projects on my own as well. Currently, I am trying to learn 3D game-making on the Unity engine too.

About Flappy Bird:

Flappy Bird is a 2013 mobile game, developed by Vietnam-based developer Nguyễn Hà Đông[2][3] (Dong Nguyen) and published by .GEARS Studios, a small, independent game developer also based in Vietnam.[4] The game is a side-scroller where the player controls a bird, attempting to fly between rows of green pipes without hitting them. The developer created the game over several days, using a bird protagonist which he had designed for a cancelled game in 2012.
The game was released in May 2013 but received a sudden rise in popularity in early 2014. It was criticized for its level of difficulty and alleged plagiarism in graphics and game mechanics, while other reviewers found it addictive. At the end of January 2014, it was the most downloaded free game in the iOS App Store. During this period, its developer claimed that Flappy Bird was earning $50,000 a day from in-app advertisements as well as sales.
Flappy Bird was removed from both Apple's App Store and Google Play by its creator on February 10, 2014, due to guilt over what he considered to be its addictive nature and overuse. The game's popularity and sudden removal caused phones with it pre-installed to be put up for sale for high prices over the Internet.[5][6][7] Games similar to Flappy Bird became popular on the iTunes App Store in the wake of its removal, and both Apple and Google have removed games from their app stores for being too similar to the original. The game has also been distributed through unofficial channels on multiple platforms.

The game below is only created for educational purposes. Credit goes to the original creator or the 'Flappy Bird' game.

No comments:

Post a Comment