PiDojo -week 1 : Getting started with the Raspberry Pi

Today we had our first PiDojo session. We had a short demo where we looked at what is possible with the Raspberry Pi.

We then had a search for projects where we saw loads of interesting ideas. We also set up one of our five new RPis.

We will continue working with the Raspberry Pi after the break so anybody who is interested can come along. All you need to bring is your laptop and an idea for a Raspberry Pi project.

Here are my slides from today Raspberry Pi presentation

Scriptcraft – Discovering the World

Introduction

Thus far, we have used Scriptcraft to build cool structures in our Minecraft worlds, but the interaction has been a little one-sided. We’ve placed objects into the world, but we’ve never stopped to ask: “What’s already there?”.

papapishu-Boys-running

That’s a powerful question to ask, because once we know what’s already in the world, our interaction with it becomes richer and opens up many new possibilities.

Objects in JavaScript

Objects in JavaScript have Properties and Methods. Properties are what they sound like; a value associated with object that we can get or set. Methods are actions, in the form of a function, that we can ask the object to perform.

If you thought of me as a Person object then you could imagine some of the Properties and Methods I might have. For Properties I might have things like NameAge, Height, Weight, etc. An example of a Method I might have could be SayHi() [notice the round brackets after the name marking this as a method]. That would make me say “Hi!”. A method might have arguments, so it could be SayHiTo(“Dave”) which would make me say “Hi Dave!”. A method could equally calculate a value. An example might be CalculateBMI() which would calculate my Body Mass Index (BMI) value based on my Height and Weight properties. On second thoughts… scratch that idea. SampleObject Exploring Existing Objects

How do we explore the objects in the ScriptCraft world? One way is to read the API documentation:

Another way is to look at the Scriptcraft code files themselves, especially drone.js.

Another handy, lazy, way to explore an object you already have a reference to in ScriptCraft is just to treat it like a string and pass it to self.sendMessage(). You’ll usually get a representation which shows some of the properties of the object and those properties’ values. It’s incomplete, but very quick and might show what you’re looking for.

Getting the Block Type

All of this was building to finding out, from Scriptcraft, what the block at a particular location is. Using a combination of the techniques listed above, I determined that I needed to call a method on the Bukkit World object called getBlockAt(). In Scriptcraft the server object has an array called worlds and the normal world is worlds[0]. For the curious; worlds[1] is the nether and worlds[2] is the end.

That’s everything we need to create a simple script to examine the block that we’re currently looking at. We can create a Drone, which is created at the block we are looking at by default, to get the location. Here is the main part of the code:

// Create a drone (will be placed at the block the player's looking at)
var d = new Drone();

// Gather information about the world, the drone's location
// and the block at the drone's location
var world = server.worlds[0];
var loc = d.getLocation();
var chunk = loc.chunk;
var block_info = world.getBlockAt(loc.x, loc.y, loc.z);

The remainder of the code is just printing this information to the console in a tidy way. We called it whats_that.js and it can be downloaded from here. The screenshot below shows it being run.

whats_that2

This will form the basis for some future projects.

Quick Final Note on Block Metadata

One final note and something that wasn’t discussed at our session last week: to fully define a block we need to know both its type and its metadata. Two wool blocks of different colours have the same type but different metadata values to distinguish them from one-and-other. Similarly steps use the metadata value to distinguish between the different possible orientations. You can use the whats_that() function to explore this.

Week 2 – 2015 Scratch Beginneers

Hi everyone,

This week we took a look at the open source graphics program called Paint.net

It’s a very useful piece of software for editing and working with photos and clip art. Over the next couple of weeks we will use it to clean up our photos of our 3D playdoh models or Lego figures.

PAINTNET

Here are the PDF version of the notes: CDA-S4-Challenge09-LearnAboutPainting.pdf

See you all next week

Python Games – Week 10: Ping Pong game

As we have covered most of the concepts required to make games using Pygame I won’t be doing any more slideshows instead we will spend all of our time writing games from now on. Today we started to make a very simple Ping Pong game and we will spend another session or two finishing it.

tennis

Anybody who has missed a few sessions is always welcome back, but now would be a great time to return as we will be explaining everything from the beginning again.

Oculus Rift!

Oculus

It’s great that CoderDojo Athenry can sometimes give young people (and parents) the opportunity to learn about and experience leading edge technologies, such as the 3D printer that Cathal Egan demonstrated at CoderDojo Athenry a couple of months ago.

In January 2015, we have another such opportunity, to try out the Oculus Rift. This is a virtual reality headset that combines 3D graphics with movement tracking, to give you the sense of being fully inside a computer generated world. Wearing it, you can look around everywhere, even over your shoulder, to see the world in 3 dimensions in all directions, and you can even move around it.

The Oculus Rift DK2 (Developer Kit 2) is an early stage technology, only available to software developers rather than the general public, but the ideas are likely to have a big impact in the future in areas such as games, entertainment, and education.

Even though we keep the demos to 2 minutes per person, it will take 3 or 4 weeks for all groups to get to try the Oculus out, because we have so many members in CoderDojo Athenry, and it also takes some time to get it set up.

Thanks a million to Ruaidhri in the Minecraft Modders group who owns it!

Tips for Staying Safe Online

Slide1CoderDojo Athenry was one of the group of 12 dojos that were the first to adopt and align with the CoderDojo Foundation’s Recommended Practice. You can read more about it here:
https://coderdojo.org/news/2014/12/22/recommended-practice-pilot-complete/

Huge thanks to mentor Neil who led this effort!

At the start of our first session of 2015 on 10 January, all lead mentors gave a short presentation with 10 tips on staying safe online. You can see the first 5 above, the other 5 are below.

You can download the presentation in PowerPoint format here: 10 Tips for Staying Safe Online PPT CD Athenry Jan 2015

We also circulated a short information document to mentors, but anybody is welcome to read it: Online Safety for Mentors CD Athenry V1.1

Slide2

Week 1 2015 – Scratch Beginners

Hello everyone and a very Happy New Year to you all!

happynewyear

Thank you all for coming yesterday. To ease ourselves back in we worked on some code for storytelling/conversations. This can add another dimension to any game. It can set the scene or can help with interaction between characters. We used speech bubbles yesterday but you can just as easily record voices instead. It’s all about the timings, you need to get those correct so that each character gets to say their piece.

Storiestelling

Here are the notes from this weeks session in PDF: CDA-S4-Challenge08-Storiestelling.PDF

Next week we are going to take a look at the graphics package PAINT.net. It would be very helpful if most people had it downloaded and installed before next week. The website is http://www.getpaint.net.

Here is a link to download it Here

See you all next week!