Sunday, 20 November 2016

Week 4

 In the fourth week, we were assigned to build two tablets, a Low-End and a High-End. For the Low-End, we should have spent on parts for the tablet no more than £250 and for the High-End no more than £400. We had to cover fields like the market area and the operating system which will run on our tablet, and for every part of the tablet we had chosen, we had to give a reason. So, I and my team had chosen to do a Raspberry Pi 3 tablet because it is a cheap tablet and the motherboard has incorporated all the necessary parts for a tablet:

  • 1.2GHz 64-bit quad-core ARMv8 CPU, 1 GB Ram
  • 802.11n Wireless LAN, 10/100Mbps Lan Speed
  • Bluetooth 4.1, Bluetooth Low Energy
  • 4 USB ports, 40 GPIO pins, Full HDMI port, Combined 3.5mm audio jack and composite video
  • Camera interface (CSI), Display interface (DSI), Micro SD card slot, VideoCore IV 3D graphics core
Here you can see a picture of the Raspberry Pi 3 motherboard:






What I have done for this project was to choose the battery and the two operating systems. For the power supply, I have chosen the PowerBoost 500C which has some interesting extras such as low battery detection, 2A internal switch, synchronous conversion, excellent efficiency, and 700 KHz high-frequency operation (for the High-End tablet I have chosen the PowerBoost 1000C, which is basically the same power supply but more powerful). For the operating systems, I have chosen Raspbian and NOOBS (New out of the Box Software) because they are optimised for the Raspberry Pi hardware. Another reason for choosing these two operating systems is the pre-installed softwares like Python, Scratch, Sonic Pi, Java, important softwares for a student (students representing our market area) and the most important reason for choosing Raspbian and NOOBS is that they are free to download.

The final cost for the Low-End tablet is £87.08, which in my opinion represents a small amount of money for what the tablet offers and the final cost for the High-End tablet is £162.05.

What we could have done better:  From what our lectures pointed, we understood that our tablet is thicker that the usual tablets which are sold on today's market, a solution can be removing some of the features like the USB ports (because the Raspberry Pi 3 motherboard has 4 USB 2.0 ports) and the LAN port. For the Low-End tablet, we could have chosen the Raspberry Pi 1 Model B, which is thinner than the Raspberry Pi 3, but less powerful.

A picture with the Raspberry Pi 1 Model B motherboard:



Week 3


 In the third week, we were introduced in C#, and in Unity. The outcome of that week was to get used with the C# scripts in Unity and to have a playable demo of a game featuring some elements like: moving non-player characters, a player that can be controlled with a keyboard and a mouse, gravity or other external forces and the display of the score on the GUI.

 The following code illustrates the movement of the main character which is controlled by the keyboard (replacing the accelerometer) and the mouse (as a substitute for the touch controls). The "if statements" are written for every arrow in order to allow the player to move the character in every desired position in order to collect the points:






 The succeeding script is for the NPC behaviour. The "transform.Translate(new Vector3(0, 1, 0) * Time.deltaTime  moveSpeed)" allows the NPC to move along the Y axis (up), moves the sprites in meters per second, and if the user wants to try different speeds the "moveSpeed" variable can be added:






 The code for the movement of the item (the one which the player needs to collect in order to accumulate points) is similar with NPC's script, but without the translate statement in the Start method: 




 To make the character interact with the other moving game object and make a certain in-game object to disappear we need to add a Box Collider to our main character and to create a new script where we need to update the Update method with a new method. The following picture will illustrate, as well, the code for displaying the score on the GUI, at the beginning of script we need to add a class variable, which needs to be private, and we need to set the initial value to 0:




 The last script is used for the camera, which is supposed to follow the player. At the start of the script we need to set some variables, the offset variable is private because we can set the values in the script. For the offset value, we can take the current transform position of the camera and subtract it with the transform position of the main character to find out the difference between the two values. In the Start method, we will declare offset value being equal to the difference between the two positions, of the screen and character: