Game Programming: A Pong Clone

Class Time!

Tonight is the first lab session for our series on learning how to program in study of games with JavaScript. Can’t wait to see everyone here in just a few hours!

Additionally, for anyone who couldn’t make the weeknight-at-7pm time slot, I’ve cleared some time this Sunday to do a repeat/additional session–Sunday, August 12th, at 3pm. You can get tickets here: https://www.wepay.com/events/intro-to-game-programming-with-javascript-weekend-edition

Or hell, just click the button:
Sunday, August 12th, 3pm – 5pm, @ Hive76 Register

Pong!

The first game is, as promised, Pong. You can see the game in action here: http://wedusc.com/games/pong.html

And you can read the source code online in my GitHub repository here: https://github.com/capnmidnight/JS_Game_Programming_Class/blob/master/pong.html

I’ll have printouts for everyone when you get here. If this is your first time trying to read code, try not to cross your eyes too much. We’ll cover how to read code along the way.

Though this game is pretty simple, it has a few interesting features…

Continue reading “Game Programming: A Pong Clone”

Intro to Game Programming with JavaScript: Update

Only 5 Tickets Left!

Wow, these things are selling a lot faster than I expected. There is still a week left and most of the tickets are gone. If you’re still interested, you should hurry and buy one to secure your place. If you are interested but can’t make it to Monday, August 6th, leave a comment on what dates would work better as I’m looking to have an alternate class schedule as well.

Some Q/A

A few questions came up in the last post, so here are some answers summarized for anyone who doesn’t read blog-post comments.

  • What time is the class? The class starts at 7pm on Monday, August 6th, 2012.
  • Can I just show up? I would prefer if you signed up for a ticket first, so I know how many people are coming.
  • Is there anything we should have/know before the class? You’ll need your own laptop computer, we don’t have enough public computers to go around at Hive. I will briefly cover some options for text editors in a blog post or at the beginning of the class, but if you already have a favorite text editor like Notepad++, Gvim, or TextMate, then by all means use that. Also, it would be advantageous for you to setup some sort of webspace. There are some free places like 110mb.com, or you could even use the Public folder if you have a Dropbox account, which is quite convenient.
  • Is it just JavaScript in general, or does it include HTML 5 and Canvas? Various HTML 5 techs will definitely be covered, eventually. You can’t really do much graphically without it. JavaScript, HTML 5, and CSS 3 all go hand-in-hand. While there are some Dynamic HTML stuff that can be done (and we will certainly cover it just because DOM manipulation is a good skill to have), eventually Canvas and Audio are a necessities.
  • Why not do <insert language> instead? That’s a really big question…

Hand-crafted Charlie-Plexed Tile

This 5×6 LED tile is a key component in a secret project that I’m developing (in secret) with some other folks (whose names shall remain a secret).

Why be so public about something so secret? Because this tile uses a layout technique that lets you build charlie-plexed LED arrays quickly and cheaply — and that’s something worth sharing.

You need to flip the tile over in order to see what’s special about it. Here’s a quick list of features that make the assembly what it is:

  • The back of the tile has six “column” conductors and six “row” conductors.
  • These column and row conductors are connected along the diagonal of the row/column array.  At all other points in the matrix, the row and column conductors are isolated via a layer of masking tape.
  • LEDs above the diagonal have their cathode connected to the conductive row immediately above the LED.  LEDs on or below the diagonal have their cathode connected to the conductive row immediately below the LED.
  • All LEDs have their anode connected to the column that is to their immediate left.

The resulting circuit allows you to individually address any of the thirty LEDs in this 5×6 matrix using only six lines from a micro-controller. Continue reading “Hand-crafted Charlie-Plexed Tile”

She Prints!

Modified MendelMax #2 was born today. Isn’t she purty. This bot is gonna live at Hive76 for the forseeable future.

Thanks to all at Hive76 for help and support during this build, especially to Rich and Andy for hanging tough in the trenches, Chris and Brendan for troubleshooting and tools, and Morfin for extra supply bits.

We’ve got big plans for this bot. Stay tuned. And here’s a video of the first print!

OpenSCAD class August 4th: Learn parametric CAD for 3D printing

I have been using OpenSCAD to design the objects I 3D print these days. Take for example my printed towel rack pictured here.

3D printed Towel Rack
3D printed Towel Rack

The design is parametric, which means that each aspect of the design is customizable. I had a specific diameter rod to use, so I entered that value into the code. If you would like to make your own towel rod, you could download the code that I wrote, and change the diameter of whatever rod you find to use. In this way the design can meet everyone’s needs with very little effort. This also means that sharing the design is much more valuable for others.

In this class you will learn the basics of OpenSCAD and reproduce a simple design from scratch. Some prior knowledge is required; basically that when you code, you need to spell things right and close brackets. OpenSCAD is fully cross platform and easy to install. Feel free to bring an idea for a 3D printed object, but make it practical. OpenSCAD does not excel at organic pretty things. Continue reading “OpenSCAD class August 4th: Learn parametric CAD for 3D printing”

JavaScript games

Just wanted to let everyone know that we’re about two weeks away from the class. You can still register for tickets at the Eventbrite page: http://www.eventbrite.com/event/3943958486?ref=elink

In the meantime, check out some of these games that other people have written to play directly in browsers with JavaScript and HTML 5 http://www.netmagazine.com/features/top-20-html5-games

In particular, if you can read code already, check out the source on Runfield. It’s not commented at all, but the code is fairly well structured.

These should give you an idea of what is possible; basically anything, really. There’s even one game that’s in 3D, *without* using WebGL. We’re not going to go that far (and honestly, I haven’t written a software rasterizer in more than 7 years), but that is quite impressive. When I started learning to program and playing around with little games in JavaScript many years ago, you couldn’t even write a full clone of the original Dragon Warrior and expect it to run at a reasonable frame-rate.

Here are a couple of more links to some game lists
http://web.appstorm.net/roundups/browsers/10-html5-games-paving-the-way/
http://www.casualgirlgamer.com/articles/entry/28/The-Best-30-HTML-5-games/

Intro to Game Programming with JavaScript

Programming is a lot of fun, and games are one of the best ways to get exposed to a variety of different programming tasks. My name is Sean McBeth and I’m versed in many ways of programming, having been working as a professional software developer for over 10 years. In that time, JavaScript has always been there for me. It is a language that everyone can run in some shape or form, thanks to the ubiquity of Web browsers; it is the BASIC of the modern computing era. Sharing that knowledge is important to me, so I am offering a class where everyone learns (or polishes) an extremely useful scripting language (JavaScript, aka ECMAScript, but NOT Java) in a very compelling medium (ahem, games).

Exclusive: Zach Hoeken on leaving MakerBot and his future.

I met Zach Hoeken Smith at one of my first Hive76 events. I donated to the pledge drive to buy a MakerBot Cupcake CNC and extruder. Once the drive was successful and 3DPO built, Hive76 held a workshop to learn how to design and print with SketchUp and the MakerBot. Our instructor was MakerBot co-founder Zach himself. Afterwards, everyone went out to West Philly for some Ethiopian food. It was a nice time. I haven’t seen him since, so I was surprised to hear from fellow member Jordan Miller that Zach had left Makerbot and was living in China. I reached out to Zach for a chat and here’s what I learned about my favorite hardware innovator. Continue reading “Exclusive: Zach Hoeken on leaving MakerBot and his future.”

Oolong, and Thanks For All The Mitch!

Zen and the art of soldering …

This Friday, we were able to inaugurate our newly completed class space with a most auspicious visitor — Mitch Altman!

PJ, Brendan, Robert et al were working until the wee hours the night before making sure that the space was ready to rock — and it was — literally.

Mitch arrived a bit before the appointed time, snapped a few photos, schmoozed, chowed down some local Chinese food etc. and, while documenting our stash of Elephant Heads,

Even this Diavolino was glad to see Mitch

anointed Hive76 as the most organized hacker space he’s seen. Quartermaster Brendan took appropriate pride in the observation.

Mitch basically talked about the Maker/Hacker movement in general, showed some of the kits that were keeping him company on the train, and weaved it all in a thematic web reminiscent of Arlo Guthrie’s is-this-guy-rambling-no-holy-shit-he’s-a-genius-because-it-all-makes-sense-in-the-end style.

After that, everyone bought a kit or two and lost themselves in the task of soldering.  I don’t know whether it’s the solder fumes or just the act of soldering itself, but I felt pretty good at the end of it all.

The new space is completely awesome and turned out to be nearly perfect for the event. Hats off to Brendan, Robert, PJ and Jordan!