Thank you all for coming on Saturday. I hope you liked the short video of the SpaceX Falcon Heavy Test Launch and the Intel Light Drones from the opening Ceremony of the Winter Olympics.
This week we did a new game, How fast can you Type? Last week we used Sprites as backgrounds and this week we used Backgrounds as Sprites. Just to mix it up!
We used a variable as our Timer, our first time doing this, don’t forget if you want the time to start when you press the first letter rather than when the green flag is clicked then you are going to have to add another broadcast.
We are off for the next two weeks, to cover the school mid term break and also as Confirmation for all the Athenry Schools takes place on the 24th of February and there will be many families attending this from Coderdojo Athenry. Best wishes to any of our Ninjas and families who are being confirmed.
Hope you all have a great break and hope to see you all back on the 3rd of March
Last Saturday we had a look at how we might figure out how far and how fast a bike is going using a Raspberry Pi. We used a very basic set up with just a micro-switch attached to a toy trike with a little nut taped to the front wheel, each time the wheel rotates the nut would “click” the micro-switch.
We would need to use a reed switch or a hall effect sensor and a magnet attached to the wheel if we were to use this on a real bike.
We started of our coding by looking at the time.time() function. This function returns the number of seconds, in decimal form, since 01 January 1970. If we want to time an event all we have to do is use time.time() to get the start time and use it again to get the end time and then subtract the the start time from the end time.
We used this to get the the amount time it takes to do one rotation. Now we want to find out how many rotations we have per minute or RPM (revolutions per minute). As our result is in seconds the easiest thing to do is calculate revs per second so we divide 1 by the time it takes to do 1 rotation and then multiply the answer by 60 to get RPM.
Now we wanted to get KPH(kilometres per hour) so first we measured the circumference of the wheel and found it was 50cm or 0.5 Metres. We then calculated metres per minute by multiplying our RPM by 0.5 and we then multiplied this by 1000 to get KPH.
Here’s a picture of what our results could look like when displayed using Pygame. We will look at Pygame later on as it’s an excellent way of displaying information.
Today in Creators, we took another look at our old friend Random and discovered that there are many kinds of random that can be used for different things (this wiki page has a surprisingly long list of other types of random … Continue reading →
This week in Advancers, Oliver was out so Mark covered. We built a platform game engine which will be really useful for powering all sorts of games and projects! Download the completed Scratch Platform Game here!! How did we build … Continue reading →
Thank you all for coming again on Saturday and welcome to our new people!
This week we looked at some of the elements we will use in A Mario game we will make in a couple of weeks time. We will use scrolling of objects in the background to achieve movement rather than making the Sprite itself move as we would normally do. It can be a difficult concept to grasp for the younger ones, but we will go through it again before we make the Mario game.
Firstly we select our Sprite and we decided we would only move left and right.
We then had to create some Backgrounds. NOTE: EACH BACKGROUND IS A SPRITE. You do not create it as you normally would.
Last week in the Bodgers group we began by looking at our new keyboards and Touchscreens. These will allow us to easily design touch based projects and projects that need a monitor. They will also be invaluable at the start of next years sessions as we can get our code on the Raspberry Pi straight away without any need to connect our laptops.
We also started planning our next project with a short brainstorming session and we have a couple of ideas we will develop further this week.
Direction and turning
We assign numbers to represent directions on the screen. Zero is right, one is up, two is left and three is down. Note then that if the snake is heading right (in the screen sense) and turns left it goes to up (in the screen sense); direction goes from zero to one. Similarly, if going up (in the screen sense) and it turns left then it goes to left (in the screen sense).
Generally then we note that turning to the left makes the direction number get bigger while turning to the right makes it get smaller. This rule hold until we get to a number bigger than three or smaller than zero; these make no sense. If direction is at zero and the snake goes right, we set direction to three. Similarly, if direction is at three and we turn left, we set direction to zero.
In the Hackers group this week, we took a large step forward in our Project SABRE (Small Autonomous Battling Robotic Entities), when we started working with remote controllers for our robots.
From what the group has read, it looks like the most widely-used controllers are Spektrum-compatible DSMX or DSM2 ones. Therefore, we bought 3x Lemon RX DSMX/DSM2 receivers and one MLP4DSM Blade transmitter (as shown in the photo).
I was away this weekend so Dave looked after the group.
He covered some basic electronics theory such as Ohms Law, how we use resistors in our circuits to protect other components and how to wire up an LED. He also helped the group build a simple traffic light circuit controlled by an Arduino which they then programmed.
The Raspberry Pi Foundation have announced that they are not running the Pioneers Challenge this year and are instead concentrating on the Coolest Projects. This means that Coolest Projects is now open to Code Club and Raspberry Jam members. There will be a UK Coolest Projects in April in London and Coolest Projects in Dublin will now be called Coolest Projects International. See more info here.
We have two sessions before the mid-term break so we will concentrate on coming up with ideas for our next projects and how we might implement these ideas and that will leave us a couple of weeks to get components etc. organized.
See you all next week.
Declan, Dave and Alaidh.
We completed our Mario game this week. We coded Mario so that he always floated down on to the wall. We added a fraction of a second of a wait so that it appears that he floats as he comes down. This also allows time for you to navigate left or right as needed.
We also introduced a more advanced concept, the Parallax effect, whereby objects further away appear to move slower than objects nearer. We coded mountains and a Sun to demonstrate this.