New Kojo Release – Version Jan-08-2012

January 9, 2012

A new version of Kojo is out. Highlights:

  • Faster Picture drawing.
  • New methods for testing for collisions between Pictures.
  • New Position and Heading related methods for Pictures.
  • Music Player enhancements (for both MP3 and composed music playback).

The Hunted sample game (accessible via the Samples -> Pictures menu item) is a good place to see a lot of this stuff in action. The game demonstrates the following ideas:

  • Making simple geometric shapes with turtles.
  • Converting these shapes to pictures.
  • Combining these pictures to create more complex pictures, which serve as game characters. Pictures are combined using transformations like rotation, translation, and scaling. The different characters floating around on the screen in the game are built out of the seven Tangram pieces. A picture represents each piece. The characters are built by combining these pictures.
  • Animating the created characters.
  • Putting in keyboard interactivity and collision detection to get game behavior.
  • Adding background music and music for game events to spice things up.

As always, the new version is available from the Kojo Download Page.

Enjoy!


New Kojo Release – Version Jan-01-2012

January 2, 2012

Following up on the previous release, a new version of Kojo is out – with some minor enhancements:

  • The sample game mentioned in the previous post, along with a new sample animation, is now available from the Samples → Pictures menu item.
  •  There’s a new command called clearWithUL(unit) that clears the screen and sets the specified unit length. The setUnitLength(unit) command is deprecated.

As always, the new version is available from the Kojo Download Page.

Enjoy!


New Kojo Release – Version Dec-29-2011 – Featuring Collision Detection

December 30, 2011

The month of December has seen the addition of some exciting new features to Kojo.

To begin with, we had Pictures. To use Pictures, kids make simple shapes with turtles, and then convert these shapes to Pictures. They can then combine pictures to come up with composite Pictures, which can be used as building blocks for further composition (and so on). Pictures can be combined using two different mechanisms:

  • A Picture building DSL (which is a Declarative API).
  • Good old Functions.

Transformations like translation, rotation, scaling, and flipping are available during the picture building process.

This was followed by customizable unit lengths (centimeters, inches, and pixels) and local picture axes – to enable kids to make complex picture objects using rational number lengths and a nice visual reference frame (the local axes) within which transformations like translation, rotation, and scaling can be applied.

And now, with this release, we have the ability to make realistic animations and games using Pictures. This is supported by the following features:

  • Collision Detection.
  • Vectors for specifying speeds and directions.
  • Fine grained definition of animation behavior via act methods for Pictures.
  • Gradient Paints for colorful backgrounds.
  • Commands to easily set the canvas background color.
  • Better keystroke handling.
  • Better support for MP3 playback.

Here’s a sample game that shows most of these features in action.

To run the game:

  • Copy the game script over from the above link and save it to a file called game.kojo on your computer.
  • Copy the background music file from here: http://kojo.googlecode.com/files/Cave.mp3, and save it to the same directory as the game script.
  • Open the game script within Kojo, and run it.

Update – the game uses a unit length of centimeters. If you run other Kojo examples after running the game, they will look blown up. To revert to default behavior, run this command: setUnitLength(Pixel). The next version of Kojo will automate this.

As always, the new version is available from the Kojo Download Page.

Enjoy! And let me know if you run into any issues. Suggestions for additional features in the Game/Animation API are also welcome.


New Kojo Release – Version Dec-18-2011 – With Cm/Inch Unit Lengths

December 19, 2011

A new release of Kojo is out. Here are the highlights:

  • Minor enhancements to the Pictures feature, in the form of the following new transformations:
    • axes – turns on local coordinate axes for a picture. This helps while assembling a composite picture out of smaller pictures.
    • rotp – rotate’s a picuture about a given point (as opposed to the origin of the local coordinate system for the picture).
    • flipX, flipY – flips a picture over around the (local) X or Y axis.
  • Support for two additional unit lengths – Centimeters and Inches. You get this going by putting the following lines at the top of your script:
    setUnitLength(Cm) // or setUnitLength(Inch).
    // setUnitLength(Pixel) is the default
    clear()

Note that actual lengths on the screen might be a little bit off, depending on the accuracy of the screen DPI (Dots per inch) information available to Kojo. Regardless of that, this feature (along with Pictures) should give kids good practice in working with fractional lengths, and rational numbers and their decimal representations.

I’ll have an article out soon – describing how to use these features to make a non-trivial shape…

As always, the new version is available from the Kojo Download Page. Enjoy!


New Kojo Release — Version Dec-09-2011 — Featuring Pictures

December 9, 2011

I am pleased to announce a new release of Kojo with some exciting new stuff.

Highlights:

  • Some great new Staging examples contributed by Phil Bagwell. These are available in the Graphics and Games section of the Scala Tutorial within Kojo (accessible via the Stories -> Scala Tutorial menu item):
  • A powerful new feature for painting called Pictures, to enable more advanced (than basic turtle programming) artistic and programming activities within Kojo. There is also a new interactive story within Kojo (accessible via the Stories -> Painting with Pictures menu item) that explains how to use this feature – with the help of live (one-click-runnable) code examples.

As always, the new version is available from the Kojo Download Page. Enjoy!


Learning to Program with Kojo (Beta Book) is available

November 15, 2011

A draft version of a new Kojo book - Learning to Program with Kojo - is available on the (new) Kojo Beta Books page.

Here’s what the book’s introduction has to say:

This book will help you to learn computer programming. After working through the book, you should be proficient at writing programs. You should also have a good understanding of the fundamental ideas involved in programming.

The book is activity based. Most chapters have the following structure:

  • A description of a problem that you need to solve.
  • An explanation of the ideas and programming techniques that you need to solve the problem.
  • Instructions on solving the problem.

Other chapters do one of the following:

  • Help you practice what you have learned.
  • Summarize important information.

This book works hand-in-hand with the (under development) series of books entitled: Adventures with Kojo. You learn the craft of programming using this book. You get to apply this craft with the activities in the Adventures books. These activities focus on Math (grades 5 to 12), and Art.

Feedback on the book is very welcome.

Enjoy!


Kind words from Martin

October 27, 2011

Martin Odersky, the inventor of Scala, had some kind words to say about my work with Kojo:

http://www.readwriteweb.com/archives/bringing_scalability_to_the_classrooms_of_the_hima.php

For those who don’t know, Martin:

  • Did his PhD under Niklaus Wirth, the inventor of Pascal.
  • Wrote the Java compiler used in Java 1.3 onwards.
  • Is a Professor at EPFL, Switzerland.
  • Is the CEO of Typesafe.
  • And is, of course, the inventor of Scala.

 


New Kojo Release — Version Oct-24-2011

October 26, 2011

A new version of Kojo, with some minor tweaks, is out.

Highlights:

  • No more runaway zooms (you could trigger one by releasing the Shift key before releasing the left mouse button during a Shift-Drag).
  • A new context menu item for the Turtle Canvas – to reset Pan and Zoom levels.
  • readInput() tries to put the Caret at the right place for the next readInput().
  • Code completion filtering works better now – more specific completions show up correctly as you type characters during code completion.
As always, the new version is available from the Kojo Download Page. Enjoy!

The Kalpana Center gets going

October 26, 2011

The Kalpana Center was launched a few weeks ago. It’s been a fun, exciting, and interesting journey so far…

I’m currently working on a Learning to Program with Kojo ebook (based on the experiences at the Center).  A draft version should be out soon.


Updated Kojo Introduction Ebook

October 26, 2011

I recently put out an update to the Kojo Introduction ebook. You can get the new version from the Kojo ebooks page.


New Kojo Release — Version Aug-31-2011

September 1, 2011

A new release of Kojo (Version: 310811-1) is out. Highlights:

  • A Scala upgrade – version 2.9.1.final is bundled.
  • Turtle commands for Staging shapes. Here’s an Example:
import Staging._
clear()
val sp = sprite(0, 0, "/home/lalit/image/casper.jpg")
animate {
    sp.forward(1)
    sp.towards(mouseX, mouseY)
}
  • New commands: repeatWhile() and repeatUntil()
As always, the new version is available on the Kojo Download Page. Enjoy!

Interview with the Scala Folks

August 25, 2011

I was recently interviewed by Phil Bagwell of the Scala team at EPFL, Switzerland.


Follow

Get every new post delivered to your Inbox.