Category Archives: PD

K12 Online Conference 2014

The K12 Online Conference has been occurring annually in the fall since 2006. In 2011, I did a presentation for the conference called Sharing Stories, Becoming Storytellers about my school’s Family Literacy Day Project.

I am excited to follow along with this year’s presentations. Today, they released the Pre-conference Keynote by Wes Fryer: Igniting Innovation in Teaching and Learning

Wes’ video presentation was centred around the metaphor of how do we spark creativity into a fire? Throughout the video he took the viewers through the process of building a roaring fire for a family campfire.  Guest videos about sparking learning were interspersed from children and teachers around the world.

I particularly enjoyed Amy Burvall’s segment where she described the process of innovation.

  1. spark: the initial idea
  2. curiosity: exploration
  3. curation:  gathering and providing examples of other’s work
  4. connection: finding like minded people.  – in person or online
  5. collaboration – also in person or online
  6. creation

I don’t think I’ve ever thought of innovation as a process before.  I love how Amy Burvall laid it out so clearly.



The theme of this year’s conference is Igniting Innovation. For two weeks, from Monday October 21 to Friday October 31, they will be releasing presentations each weekday at 8:00 am EDT in four strands: Stories for Learning, Games and Gamification, Passion Driven Learning, and STEAM. I am particularly interested in the Games and Gamification strand, and will likely follow it closely.

Here is the 2014 K12 Online Conference Schedule.  You can also follow them online on Twitter, Facebook and a video podcast channel in iTunesU.   The twitter hashtag is #k12online.

Oct 20, 2013

I was inspired by both of today’s presentations

6 Second Stories for Learning by Ben Wilkoff @bhwilkoff


I was awestruck that the bulk of this presentation was 103 six-second vine videos strung together.  But even more by the concept that some stories can be small– even just a moment.  This reminds me of the Small Moments stories we sometimes write in Primary grades.  See:


Game On: How Design and Play Impact Learning by Kevin Hodgson  @dogtrax


I loved how he compared his unit of creating video games as a grade 7 science unit to the time honored project of having students write their own picture books.  He also had some key slides showing how much of the curriculum is covered by creating games… not to mention developing social-collaborative skills, and problem solving skills.  He also had a key slide where he compared the writing process to the process of designing a video game and they are nearly identical.


#Gamifi_ED Networked Intergenerational Learning

This presentation described how a group of teachers and students have created an online project:  Gamified to explore how to use games in education.  The key take away is that it is an inquiry based project with collaborators from all over the world and the students and educators are all co-learners.


Digital Story Telling Through App Smashing

Caroline Doughty: @msdoughty2 is a 2nd grade teacher who uses “app smashing” to have her students create projects and inquiries.  She is doing some amazing things but it is not about “app smashing:– using more than one app to create a project.   It’s about inquiry.   App smashing is not some marvelous new thing.  We aren’t “app smashing” we have a drawing, text, and a skit in the same presentation– Just using a variety of tools.  The point for me is that whenever we are learning (or teaching) , we have an incredible palette of mediums that we can use.  I’ve been trying to impress on students and teachers that we have to foster the skill of choosing which medium (text, podcast, crayon, bitstrips, interpretive dance, etc…) is best suited for our message and our audience.


We Are All Connected

I greatly enjoyed this presentation just as a bit of documentary film making.  Tim’s video and photographs are a visual treat. He told a story of how he encountered graffiti from  a man on a fundraising walk across the US in an abandoned gas station in the Texas desert.  He took photos of the graffiti, then researched the man online.  He found his blog, from 2007, and wrote a blog post about it.  This led to the two of them connecting on line.

It’s a small world.  I myself have had dozens of this kind of small-world encounters over the past decade as a blogger, podcaster, audio book narrator, etc…   How can we provide this kind of connections for our students?

His core message was that with the internet we are all connected.  We need to reach out online and find the like minded educators.  I remember that at my first Podcamp in 2007, I was invited to perform at the evening concert- looking down at the audience full of podcasters, nerds, and geeks, I declared.  “I have finally found my tribe.”  As professionals, we need to find our place in a community of educators– in our school buildings, and in the world beyond.

Tim said, “We can choose to drive down the road by ourselves, or we can drive with our friends.  We are all connected. … I hope that you choose to connect- not only yourself, but your students and teaching.  I guarantee it’s worth the trip”.



EdCamp Barrie

I am a big fan of Edcamps so I was thrilled that one was organized just 1/2 an hour from my home.   Here we are on September 27 on a Saturday having some great participant-driven conversations about education at EdCamp Barrie.

As usual, I’m posting here to have all my musings and learning from this event in one place.


Live Edcamp Barrie Schedule

Edcamp Barrie Conversation on Twitter


Here is Deb McCallum’s storify wrapup of Edcamp Barrie



My 10:30 session:  

Session Shared Notes: Session 1.181  iPads  

My key learning:

I liked how this conversation focused on How to use and manage ipads to best differentiate learning and to have the students create rather than consume content.

From the shared doc:

Ipads in schools:  It’s not about installing any old app they can play with at home.  It’s about using these powerful tools to create rich learning.

Ask the kids how they want to use them.

The integration with Google apps is really the ‘secret sauce’  It allows sharing, use anywhere, etc…


  My 11:15 Session: Session Shared Notes: Session 2.163 Game-Based Learning

My Key Learning:  This conversation seemed to centre on using minecraft and other games to enhance and enrich learning.  There was also some mention of specific gameish educational sites and apps.   I was hoping to bring up the concept of gamification but time ran out.


Lunch:  I sat with Melissa Jensen @mjtbarrie, our boards library consultant, and several other teachers.  We discussed how to overcome some of the challenges we are having with the new iPad rollout in our schools, and Melissa gave me some tips for using our computerized catalogue tool in our libraries.

1:00 Coding Session Shared Notes: Session 3.165 Coding

My Key Learning:

Diana Boulanger  @mcd_boulanger gave us an amazing demonstration on how she uses coding with hopscotch in her grade 3/4 and FSL programs. 

1:45: BYOD:  Session Shared Notes:  Session 4.163

My Key Learning:  Some great suggestions for the practicalities of BYOD and how to teach students when and how to use and not to use your devices.

2:45 Wrap-Up SLAM

1: Use Google forms and mapping addon to mass source map data. 

2: Louise’s mood check form– connected it to a QR code.  

3:  Scott


Edcamp Design Thinking


Picture and more ideas about DT at Design Thinking For Educators

My brother in law and I arrived about an hour late for Edcamp Design Thinking. We immediarely dove into Wikipedia:Design Thinking. We were dropped into the midst of a World Cafe Conversation about what is Design Thinking, What do we already know about DT. It seemed very similar to me to the inquiry based learning workshop I attended yesterday.


The organizer of Edcamp DT, Jennifer Chan, made a storify story of the event as told on twitter.  I appear once or twice.

It was a great event in a fabulous space. I hope they do it again.

Python Project and CCOW Week 6 reflection


During week 4, I took a good look at my multiple motivations for taking part in CCOW.  They were:

1)  I want to master SCRATCH so that I can better teach it to my students, and so  that I know more of it’s potential uses (particularly in the elementary grades that I teach).

2) I want to learn how to code again… not  just as a subject to teach but as a creative outlet for myself.  

3)  I want to read more about and reflect upon Constructivist principles in my teaching and learning.  

Given these 3 objectives here is a first try at framing a project idea:

I want to learn to code.  I would make the leap from Scratch to Python, which is a more multi-purpose language.  I could use it to code for the web or to make apps for my handy android phone.  So…  I will try to use a ‘How to code in python’ manual  as a guide to create a game in scratch

1) I want to build upon my experience using Scratch to teach myself how to Code in Python.

2) I want to document my personal experience and explore how I can help my students make the transition from SCRATCH to real-world programming.


So what?

I found some great online resources for teaching yourself scratch (mostly geared at children).  The ones I used most were

I played with a variety of python IDEs (Integrated development environments) before settling upon pyscripter for windows as one that works for me.

I typed, debugged, debugged, debugged, modified, and debug several python programs from the above ebooks and tutorials.

I recreated a starfield simulation created in python by codeNtronix into a scratch program.

I thought, reflected and wrote lots and lots and lots and lots and lots and lots.

Now what?

I want to continue monkeying with python so that I can gain enough proficiency that next time I say, “Someone ought to create an app, program or plugin to do…”,  I might attempt to be that someone.

I am considering starting a lunchtime programming club at my elementary school as an extension to the lessons in SCRATCH I have taught as one of the schools Library&Technology teachers.


Thank you to the Creative Computing Online Workshop team for providing such a wonderful opportunity for professional development.


There are Many Reasons to Learn to Program

In the above video from a variety of celebrities make a case for why programming should be taught to all children.  It is worthwhile to watch the full 10 minute video at also offers links to a variety of learn to program resources, including Scratch.

During this project to transition from Scratch to learning to program in Python,  Madeline Bishop has twice made comments on my post suggesting that my journey moving from scratch to python would help students wishing to pursue career.  She asked:

Do you have any idea of how many kids transition from Scratch into another language?  How many go on to have IT career?

My first reactions were– I don’t know  and I don’t really care.  But this comes off as blunt and doesn’t fully explain my thoughts on teaching myself how to program, or teaching children how to program.

To explain, I have to tell a little bit about myself-  I am a singer- songwriter, I play guitar and bass, I am a podcaster, blogger and have dabbled with creating websites since the early web. I dabble with photography and video. I was an early volunteer for recording public domain audiobooks.  I am a fan and proponent of open source software and make liberal use of public domain and creative commons media.  And I am a slow but persistent home handyman– I told my wife I am restoring our house on the 21 year plan (7 years in and it is starting to look quite nice).

As a regional children’s entertainer and folk songwriter, I have long become accustomed to well meaning questions of “So when can you quit your day job?”  The answer is “Never”.  But I derive immense pleasure from writing and sharing my music with others.  When I get the odd paying gig, it helps subsidize my gear buying habit. But I derive far more value from all my creative endeavors than just monetary value.  I think one of the greatest values is that I approach the world as a creator– rather than a consumer: of music, of media.

So learning to code for me is another creative outlet.  For me it is a liberal art… not just a means to a career path.  I found an article that develops this idea better than I can explain it:  Why Everyone Should Learn to Program by Dan Haggard.  In it, he explains how teaching himself to program in python has enabled him to do his work as a university administrator more efficiently.  Let me share just a brief snippet that gets to the heart of his argument:  (emphasis is all mine)

Given the relative ease in learning the basics of programming in scripting languages like Python, the time has come to challenge the assumption that programming is a specialisation.  If you need an analogy:  is learning to read and write in a spoken language like English – a specialisation?  No, it’s a fundamental tool needed to navigate your contemporary existence.  It’s easy enough to learn that you devote some of your early years to the task – and then it stays with you for life.  You could go on to specialise in language use.  Maybe you’ll go on to become a writer.  But you don’t need to specialise for your language skills to provide you with an incredible level of life-improvement.  Well – so to with programming.

What’s more – I now feel cured of an affliction I never realised I had.  If I had to name this affliction, I’d call it –defaultism.  Always did I just default to the way of things as it was handed to me.  Now I look at every aspect of my life with a hacker’s eye.  How can I free myself of this task? – is the question now at the forefront of my mind at all times.  There is no need to throw out every interface with which we are presented.  If it fits our needs and desires then fine.  But how often do you subvert your own desires and needs because of the constraints imposed by the limitations of the interfaces with which you have been bequeathed?

I also found a nice contrasting view by Jeff Attwood at Coding Horror entitled: Please Don’t Learn to Code.  Atwood’s key arguments centre around the idea that skilled programmers do not just produce lines of code.  The are problem solvers who through years of experience develop certain ways of approaching and solving problems.  He writes:

Look, I love programming. I also believe programming is important … in the right context, for some people. But so are a lot of skills. I would no more urge everyone to learn programming than I would urge everyone to learn plumbing. That’d be ridiculous, right?

In the final paragraphs of his article, Atwood seems to come closer to what I have been getting at:

The general populace (and its political leadership) could probably benefit most of all from a basic understanding of how computers, and the Internet, work. Being able to get around on the Internet is becoming a basic life skill, and we should be worried about fixing that first and most of all, before we start jumping all the way into code.

Please don’t advocate learning to code just for the sake of learning how to code. Or worse, because of the fat paychecks. Instead, I humbly suggest that we spend our time learning how to …

  • Research voraciously, and understand how the things around us work at a basic level.
  • Communicate effectively with other human beings.

These are skills that extend far beyond mere coding and will help you in every aspect of your life.

Both articles suggest that knowing how computers and programming work are a life-skill rather than just a career-path.  They teach us a certain approach to problem solving and how to think.

Back to the initial question of how does my Scratch help kids transition to an IT career.  I still don’t know.  But I have found out through my readings and learning a bit about Python, that Python is a great first or second programming language that allows someone lots of opportunity to explore a variety of styles of programming and almost limitless applications: whether it be making games, applications for the web, mobile apps, or complex scientific mathematics.   So yes, I guess it could be a first step to exploring an IT career,  or the first step to becoming a creator rather than consumer.  I find the latter idea much more compelling.


Photo by peacenik1 on flickr

CCOW Week 5 Wrapup


SeaCow- Fritzfranz Fride- flickr

This week I immersed myself in learning the basic principles, structure and commands of Python, so I did not do many of the week’s optional activities.  Here is a summary of how I approached week 5.

Help with Scripts:  I went on to the Help with Scripts discussion forum on the Scratch website a couple of times and read through the posts but I did not find any posts where I could give specific, constructive help that someone else had not already answered better.  Pro-tip:  When asking for help on a forum have a specific question in mind, and give as much detail as you can about the difficulties you are encountering.

Hardware and Extensions:   I did not do anything with this activity other than to think to myself, “Gee whiz there are a lot of neato gadgets that you can interact with using scratch”.

Unfocus Group:  I greatly enjoyed this activity but I ended up having an unfocus group of one.  I sent out emails to a musician friend who is also an open-source advocate and programmer, another tech crazy elementary teach in Nebraska, and a childhood friend who I learned to code with when we were 13 or 14.  Only Brad, my childhood friend was able to take some time  with me to discuss my project.  Unlike me, Brad continued to explore computer programming throughout his life.  He is a freelance programmer and database designer who now lives in northern Minnesota.  We had a wide ranging skype chat that meandered in the manner of  conversations between old friends.

Brad was fascinated by the concept of SCRATCH as a programming language to teach programming.   He also gave me several suggestions about choosing an Integrated Development Environment (IDE) including Eclipse (which is free and open source) and JetBrains, which is a commercial product but it has several cheaper or free options for teachers or open-source projects.  Brad’s point was if you choose get a multi-language, full-featured IDE, then you don’t need to relearn your programming environment every time you have a desire or need to learn a new programming language.

As I am writing this Brad popped up in my skype window… (I love years long, asynchronous text conversations).   He writes:

[10:47:50 AM] Brad: Heh, of course, there is a good argument to be made that no-one appreciates what an IDE does for them until they first use a text-based editor.  Notepad++ is a very nice text editor and has all the hooks into any language you want to use, plus user-customizable language settings too.  So maybe the need to pick an IDE is not as great as the need to just simply starting to build something.

I have used Notepad++ for years when I need to directly work in html code.  I have used it during my python explorations and it is very effective at color coding and indenting python code.  It does not have an integrated python interpreters or debuggers so you have to run your program within python or another IDE.  Otherwise it is a fantastic editor for almost any language or situation when you have to directly edit or write code.

Activity Extension:  I looked at the templates for making a Scratch card, but decided to devote more time to my Python Project instead.

Workshop Project: Reporting Out and Checking In 

Here’s our checklist for this activity…

  • Add a page in your design notebook and share an update about your independent workshop project progress, by responding to the red/yellow/green reflection prompts:



Red: What are some elements of your project that aren’t going well, that you’re worried about, or that you’d love advice about?

The thing I find most frustrating. is the amount of time it takes to type then to debug code.  I think the metaphor of programming language to spoken language is appropriate because they say it takes 1-2 years to gain facility in a new language.  This is beyond the scope of a 3 week project, but I have made a good start at learning.



Yellow: What are some elements of your project that you are just OK, or that you’re feeling ambivalent about?

I’m going to reinterpret this question to:  What else do you want to write about or explore?   A couple of times a commenter has asked me about how my project can help students jump into a career in IT.  As a podcaster and musician, I have a knee jerk reaction to “How do you make money doing THAT?” questions of “I don’t know and I don’t care”.  But this question needs a longer and more sensitive blog reflection which I would like to write this week. 




traffic_light_green_dan__01Green: What are some elements of your project that are awesome or that you’re excited about?

I am enjoying the problem solving and puzzle nature of learning to make games in a new programming language.  I would like to continue doing that, even after the CCOW workshop ends.


Other Posts for Week 5:  

And One More Thing:

This week I installed two wordpress plugins into my blog to display python code (and indeed almost any kind of programming code) with correct formatting and color coding:   W-P Code Highlight and  Sunburst Code Prettify.

Recreating a Python Simulation in Scratch

Cooriemungle_Water_Tank_Cow_Monster-wikimedia-commonsIn my last post, I added my own modifications to the tutorial  Making Breakout by Leonel at codeNtronix.   He also has a number of tutorials about drawing 3D graphics using python and pygame.  I was intrigued by his simulation of a 3D Starfield made using Python and Pygame.  (Thanks Leonel for creating such useful tutorials).


His simulation uses a few basic 3D to 2D algorithms, which I don’t fully understand but they are effective at creating the desired effect.  He created this effect with just 80 lines of source code,  Click here to download the full source code from CodeNTronics.

I analysed the code myself to see if I could recreate this simulation in Scratch.

3D Starfield

Scratch Code:  Takes 31 lines of code and painted backdrop and sprite costume in the paint editor.starfield-scratch-stage-codestarfield-scratch-starsprite-code


Python code:  81 lines from CodeNTronics, with comments added by me.

# """
# 3D Starfield Simulation
# Developed by Leonel Machava <>
# """
import pygame, math
from random import randrange

class Simulation:
    def __init__(self, num_stars, max_depth):  # SM- each star needs an individual variable for x,y,depth.  
        pygame.init()   # SM-- does a bunch of pygame stuff to set up screen and clock.

        self.screen = pygame.display.set_mode((640, 480))
        pygame.display.set_caption("3D Starfield Simulation (visit")

        self.clock = pygame.time.Clock()
        self.num_stars = num_stars
        self.max_depth = max_depth

        self.init_stars()  # SM- Tells the program to make the list of stars

    def init_stars(self):
        """ Create the starfield """
        self.stars = []
        for i in range(self.num_stars):
            # A star is represented as a list with this format: [X,Y,Z]
            star = [randrange(-25,25), randrange(-25,25), randrange(1, self.max_depth)]

    def move_and_draw_stars(self):
       # """ Move and draw the stars   """   SM Converts the xy coordinates to cartesian to centre stars on screen
        origin_x = self.screen.get_width() / 2
        origin_y = self.screen.get_height() / 2

        for star in self.stars:
            # The Z component is decreased on each frame. SM-- Star Moves closer
            star[2] -= 0.19

            # If the star has past the screen (I mean Z<=0) then we
            # reposition it far away from the screen (Z=max_depth)
            # with random X and Y coordinates.
            if star[2] <= 0:
                star[0] = randrange(-25,25)
                star[1] = randrange(-25,25)
                star[2] = self.max_depth

            # Convert the 3D coordinates to 2D using perspective projection.
            k = 128.0 / star[2]   # SM I don't know where Leonel got this constant 128/depth but it works
            x = int(star[0] * k + origin_x)  #SM-- moves starfield origin towards centre of screen
            y = int(star[1] * k + origin_y)

            # Draw the star (if it is visible in the screen).
            # We calculate the size such that distant stars are smaller than
            # closer stars. Similarly, we make sure that distant stars are
            # darker than closer stars. This is done using Linear Interpolation.
            if 0 <= x < self.screen.get_width() and 0 <= y < self.screen.get_height():
                size = (1 - float(star[2]) / self.max_depth) * 5
                shade = (1 - float(star[2]) / self.max_depth) * 255

    def run(self):
        """ Main Loop """
        while 1:
            # Lock the framerate at 50 FPS.

            # Handle events.
            for event in pygame.event.get():
                if event.type == pygame.QUIT:


if __name__ == "__main__":
    Simulation(256, 32).run()


The python program presents a much more realistic starfield and is much more versatile. But the scratch program accomplishes the same task in 1/4 the length and it is much easier for me to tinker with the variables and formulas to change the appearance in SCRATCH. It is an accomplishment that I can understand enough of Python to recreate the essential features of a program in SCRATCH. To use the analogy of spoken languages, I think that I have progressed to the point that I can understand a bit of what I read and hear in PYTHONESE, but I cannot yet speak it like a native. This is very good progress for 10 days. To extend the spoken language analogy, one of the common exercises for people learning a second language is to translate passages from one language to another.  That is exactly what I attempted here, and I am quite satisfied with the results.

In which I Pursue Progress with Programming in Python

99er MagazineIn  1981 or so, my brother and I were 12 and 13 years old and we both had paper routes.  We pooled the fruits of our paper carrier jobs, and Dad took us down to the Alberta Treasury Branch where he co-signed a $1200 personal loan at a whopping 23% interest so that we could buy our first personal computer– a TI-99/4.  In fact it was the first personal computer anyone had in our neighbourhood.  We poured over the accompanying manuals, got all sorts of books from the library, and subscribed to 99er magazine.  These early computer enthusiast magazines offered articles about the future of computing, ads for enticing new peripherals and gadgets, and most importantly programs.  Each magazine contained printouts– recipes I guess, for dozens of programs.  We learned to program by painstakingly copying programs from printouts in these magazines, even more painstakingly debugging our errors then figuring out how to fix the inevitable mistakes in the magazine’s code.

30 year later, as I make the transition from SCRATCH, to PYTHON, I find myself transported back to the same learning process.  As I undertook to learn a new programming language, I found myself seeking out familiar “Teach yourself programming by copying these game’ books.  But this time I did not need to go to the magazine stand, or the library, or order in by mail.  The resources are all a google away.  I think it says something about my personal learning style that I chose the cookbook style of print resources over the many multimedia and video tutorials available on youtube.

I’ve spent most of the last week trying to understand some of the basic structure and commands of python, as I worked my way through a variety of tutorial programs.  First impression is compared to scratch there is alot more fiddly typing and figuring out exactly how to initialize then execute each step.  Unlike scratch, it is much harder in python to just poke around and see what will happen.  If you don`t know the precise order, structure, and syntax for any small part… the whole program may not even start.  I think here is a fundamental difference between Scratch and python.  Constructivist philosophy is at the core SCRATCH.  It is designed to be explored, tinkered with and discovered.  On the other hand, Python is designed to be functional, readable, and infinitely extensible.  Alex Martelli, author of the Python Cookbook, summed up the Python Philosophy:

To describe something as clever is not considered a compliment in the Python culture.” Python’s philosophy rejects the Perl “there is more than one way to do it” approach to language design in favor of “there should be one—and preferably only one—obvious way to do it”.  From:  Python Programming Language on Wikipedia.

Bricka by codeNtronix

Download the original Brika Source code from codeNtronix

and here is my revised source code for Bricka.

 bricka (a breakout clone)
 Developed by Leonel Machava <>

with revisions by Sean McGaughey
during Creative Computing Online Workshop

import sys, pygame
from pygame.locals import *

SCREEN_SIZE   = 640,480

# Object dimensions
BALL_RADIUS   = int(BALL_DIAMETER / 2)   #source code was just BALL_DIAMETER / 2 This through an error of floating point vs Int error
                                        # I added an int function to make sure it is an integer value


# Paddle Y coordinate

# Color constants
BLACK = (0,0,0)
WHITE = (255,255,255)
BLUE  = (0,0,255)
BRICK_COLOR = (200,200,0)

# State constants

mousex = 0 #x coordinate of mouse event
mousey = 0 # y coordinate of mouse event

class Bricka:

    def __init__(self):

        self.screen = pygame.display.set_mode(SCREEN_SIZE)
        pygame.display.set_caption('bricka (a breakout clone by')

        self.clock = pygame.time.Clock()

        if pygame.font:
            self.font = pygame.font.Font('freesansbold.ttf',20)
            self.font = None


    def init_game(self):
        self.lives = 3
        self.score = 0
        self.state = STATE_BALL_IN_PADDLE

        self.paddle   = pygame.Rect(300,PADDLE_Y,PADDLE_WIDTH,PADDLE_HEIGHT)
        self.ball     = pygame.Rect(300,PADDLE_Y - BALL_DIAMETER,BALL_DIAMETER,BALL_DIAMETER)

        self.ball_vel = [5,-5]


    def create_bricks(self):
        y_ofs = 35
        self.bricks = []
        for i in range(7):
            x_ofs = 35
            for j in range(8):
                x_ofs += BRICK_WIDTH + 10
            y_ofs += BRICK_HEIGHT + 5

    def draw_bricks(self):
        for brick in self.bricks:
            pygame.draw.rect(self.screen, BRICK_COLOR, brick)

    def check_input(self):
        for event in pygame.event.get(): # event handling loop
            if event.type == QUIT or (event.type == KEYUP and event.key == K_ESCAPE):
            elif event.type == MOUSEMOTION: # I added these mouse controls.  It works well.
                mousex, mousey = event.pos
                if mousex >= MAX_PADDLE_X:
                    self.paddle.left = MAX_PADDLE_X
                    self.paddle.left = mousex

            elif event.type == MOUSEBUTTONUP:
                mousex, mousey = event.pos
                self.paddle.left = mousex
                mouseClicked = True
                if self.state == STATE_BALL_IN_PADDLE:
                    self.state = STATE_PLAYING

        keys = pygame.key.get_pressed()

        if keys[pygame.K_LEFT]:
            self.paddle.left -= 5
        if self.paddle.left < 0:             self.paddle.left = 0         if keys[pygame.K_RIGHT]:             self.paddle.left += 5         if self.paddle.left > MAX_PADDLE_X:
            self.paddle.left = MAX_PADDLE_X

        if keys[pygame.K_SPACE] and self.state == STATE_BALL_IN_PADDLE:
             self.state = STATE_PLAYING
        elif keys[pygame.K_RETURN] and (self.state == STATE_GAME_OVER or self.state == STATE_WON):


    def move_ball(self):
        self.ball.left += self.ball_vel[0]  += self.ball_vel[1]

        if self.ball.left <= 0:             self.ball.left = 0             self.ball_vel[0] = -self.ball_vel[0]         elif self.ball.left >= MAX_BALL_X:
            self.ball.left = MAX_BALL_X
            self.ball_vel[0] = -self.ball_vel[0]

        if < 0:    = 0             self.ball_vel[1] = -self.ball_vel[1]         elif >= MAX_BALL_Y:
            self.ball_vel[1] = -self.ball_vel[1]

    def handle_collisions(self):
        for brick in self.bricks:
            if self.ball.colliderect(brick):
                self.score += 3
                self.ball_vel[1] = -self.ball_vel[1]

        if len(self.bricks) == 0:
            self.state = STATE_WON

        if self.ball.colliderect(self.paddle):
            self.ball_vel[1] = -self.ball_vel[1]
        elif >
            self.lives -= 1
            if self.lives > 0:
                self.state = STATE_BALL_IN_PADDLE
                self.state = STATE_GAME_OVER

    def show_stats(self):
        if self.font:
            font_surface = self.font.render('SCORE: ' + str(self.score) + ' LIVES: ' + str(self.lives), False, WHITE)
            self.screen.blit(font_surface, (205,5))

    def show_message(self,message):
        if self.font:
            size = self.font.size(message)
            font_surface = self.font.render(message,False, WHITE)
            x = (SCREEN_SIZE[0] - size[0]) / 2
            y = (SCREEN_SIZE[1] - size[1]) / 2
            self.screen.blit(font_surface, (x,y))

    def run(self):
        while 1:
            for event in pygame.event.get():     # I added these lines from Sweigart, making Games with Python
                if event.type == pygame.QUIT:
                    sys.exit                    # To check for Quit


            if self.state == STATE_PLAYING:
            elif self.state == STATE_BALL_IN_PADDLE:
                self.ball.left = self.paddle.left + self.paddle.width / 2
        = - self.ball.height
                self.show_message('PRESS SPACE TO LAUNCH THE BALL')
            elif self.state == STATE_GAME_OVER:
                self.show_message('GAME OVER. PRESS ENTER TO PLAY AGAIN')
            elif self.state == STATE_WON:
                self.show_message('YOU WON! PRESS ENTER TO PLAY AGAIN')


            # Draw paddle
            pygame.draw.rect(self.screen, BLUE, self.paddle)

            # Draw ball

  , WHITE, (self.ball.left + BALL_RADIUS, + BALL_RADIUS), BALL_RADIUS)

            self.show_stats ()

if __name__ == '__main__':



Here is my first attempt at programming a game in Scratch from November of 2011.


CCOW – Week 4 Wrapup Post and Python Project Progress

CC photo by on flickrIt’s the end of the last  (Professional activity) day of school.  The children finished, and my office/classroom is packed up till late August.

Back to my regularly scheduled CCOW Activities.

I dabbled this week at some of the Week 4 activities.  I skipped the advanced features activity because I have been trying to use some of Scratch 2.0s advanced features in previous weeks.  I looked at some of the resources on the ScratchEd site for the Activity Exploration but I did not keep track of the ones I looked at.

My focus has been on my Personal Project to Pursue Programming in Python as a Pastime.    As I delve into the resources, my  focus is getting clearer.

1) I want to build upon my experience using Scratch to teach myself how to Code in Python.

2) I want to document my personal experience and explore how I can help my students make the transition from SCRATCH to real-world programming.

The focus for me is strongly on 1)– I (Sean McGaughey- life long learner, and dabbler in all sorts of creative endeavours) want to learn more advanced programming.  I was thinking that because of this primary focus that my project might be beyond the scope of the CCOW workshop.   I think I was mistaken.  All the feedback I have had about this project has been positive.  I was greatly encouraged when 2 of the facilitators (Ingrid and Laura I think) each mentioned my project on CCOW office hours yesterday.   It seems that many people are interested in how to move from SCRATCH’s controlled sandbox into the big Programming Playground beyond.  I hope as I chronicle my transition it can be helpful for other teachers and their students.

Reflections from my first few days working with python.

  • I chose python over javascript, java, or other multipurpose languages because it seemed to be used for tons of things from games to the internet to sciencific calculations, to mobile apps.  Also there are tons of free online resources and tutorials to teach yourself python, and many of them are geared towards children.  I am keeping a list of the links I find using diigo.
  • I spent a lot of time researching IDE (Integrated Development Environments) for python.  Think– word processors that also check your code for you, help you by automagically finishing what you are typing, and like scratch provide some kind of stage or window to show your code in action.  Python comes with a perfectly good IDE called IDLE, but I investigated about 6 before I settled upon pyscripter for windows.  It autosuggests commands and variables,  it automatically completing brackets and auto-indents lines of code into blocks.  This makes it easier for me to learn the correct use of spaces and indentation.  It also has very intuitive syntax-checkers and debuggers which are also helping me understand how to structure code in python.  *Next week I should write a blog post comparing the IDE of scratch to some of those available for python and other programming languages.
  • Does anyone know of an IDE for python that has the same main features as SCRATCH– ie Stage to run the program, heirarchical lists or menus of available commands, editor to put the code in?
  • Bah!  The Training Wheels are definitely off.  Python is fiddly– Spaces, punctuation, case, and indentation all have meaning.  Make a simple error in any of them and the program will not run.   (Fortunately a good IDE will help to make it easier to learn the ‘rules of the road’ for how code should be structured.

Resources I have used this week:

I have been trying to specifically use ‘python for kids’ books because they are aimed at beginners and because I want to know what is available for my students.  I found 3 to be very useful.

All three of these resources are available for free online, but each of the authors also has newer revised editions of these books available for purchase as paper books or ebooks.   I like the playful, humour filled style of all three authors and I am sure kids would enjoy them too.

Potential blog posts:  

      • Compare the object oriented nature of scratch (Sprites and Code blocks snapped together) with python (Functions, modules and libraries).
      • Prepare some code examples in both Scratch and Python
      • Make a bit of a graphical metaphor using buckets, boxes or something to show how python interchangeably uses variables, lists, tuples, functions, libraries etc… *Basically– anything you can give a name and value to can be used in place of any other thing that outputs a value– “If you know the correct syntax– erm ‘the magic words’ “.

That’s all for this week.  I’m looking forward to spending more time with CCOW now that school is over.

 My other week 4 posts: 

Coder’s Log Terradate 26.06.2013

Week 4- Workshop Project: Defining and Planning