Pages

Friday 31 May 2019

Sphero Game

In DTE we have been learning to code using a variety of programs. At the start of the topic, we used a web program called RobotMagic in which we coded a robot called Bob to do tasks we are assigned to do. It was an entrance to block code, which we would be using to command Sphero's

Spheros are little robot spheres that are commanded by many different types of code. You download the app on a mobile device such as an Ipad or phone, and you can control it from there. At the start of using them, we controlled the spheros manually via the app where we could use a joystick sort of control and we could change the colour. After we moved onto coding. We started with block coding and went through some activities wherein the first activity we learnt the basics of coding. Then in the following activities, we made games that we played. We made two games, a toss game where you had to throw the sphero and whoever held it after the tenth or so toss was out, and a hot potato game where the game is similar to the toss game but there was a time limit. Then we were given another task, make our own game. Here is mine:

The game I plan to make is a game where you have to roll the ball to another person manually as many times as you can in 60 seconds. However, if the roll hits over 3G’s, then you lose.

The program goes

Stabilizer: Off
Loop Forever
If Total Accelerometer > 3 Then
  Play Fail Sound and Wait
  Strobe Red for 0.2s 10 Times
  Raw Motor left 255 right 255 fr 5s
 Else
  Main LED Blue

The program uses an if then else statement so that if the total accelerometer (X, Y, Z) exceeds 3 g’s then play the fail scenario but the else statement keeps on going

I've enjoyed playing with the spheros this term and I am excited about moving on to the next topic. Next time I want to work with people to create a game together and/or combine the games.

Thank you for reading my blog, please give feedback as it helps my learning

No comments:

Post a Comment

Note: only a member of this blog may post a comment.