Posts Tagged ‘ Processing

Android anyone?

android01While I’ve really been enjoying coding with Pygame and Python… one thing they don’t seem to be able to do is play well with mobile phones.  Specifically things like the iPhone and Android devices.  Everyone I show my BubblePaint Pygame program to has the same comment:  You should put that on the iPhone!  And I’d love to!  But I don’t see Python entering into the iPhone’s future anytime soon, and I have no real want to learn Objective-C or C++ for iPhone dev.  Plus, I really don’t want to have to buy a Mac just to release my iPhone apps :-S

Enter Android.  Can develop for it on the PC (plus!).  Uses Java as its programming language.  And now appears to support Python scripting!  So far so good! (well, other than the fact I signed a 2-year deal with AT&T so my wife could get an iPhone <wink> )

I’m a bit warmer to Java than other languages based on my familiarity with Processing.  But I still really don’t “know Java” (however I have to say that Processing was a gentle introduction).  So I went out this weekend and picked up these books:

Then I:

  • Installed Eclipse IDE, since the Android platform has some Eclipse-specific plugins to aid in it’s development.
  • Installed the Android SDK (thanks to this post)

And finally I:

  • Started reading the Java book.

I’m now on… day 3… of 21.  It’s going pretty fast since Java is not so unlike Python in many regards.  The only thing I find unfortunate is that the more I learn of Java… the more I miss Python.  Python’s dynamic typing is sooooo much more conducive to my brain than Java’s static typing, and the stripped down syntax of Python just makes me feel… cleaner, compared to all the brackets, semi-colons, variable casting and whatnot needed in Java.  Bah!  End rant.

We’ll see where this leads:  I really like the idea of making games on mobile devices, and Android seems like an accessible platform.  I just hope AT&T starts selling the devices soon (the emulator will only get me so far) and learning Java doesn’t  cause me to rant too much….

:-)

Just ran into HYPE

HYPE appears to be to ActionScript 3 as Procesing is to Java.  I like seeing these higher-level wrappers of the languages available to the user community:  I was really excited when I first started using Processing, it opened a lot of doors for me creatively.  Looking forward to seeing what the HYPE user-community produces.

What to make a game in, part 2

After some serious thinking (based on my previous post), I’ve decided to go with PyGame as my initial platform for making a game.  As much as I like Processing for making ‘interactive visuals’, the more I learn Python, the more I like it (as in, the language itself… Python has no great graphics abilities on its own).  The syntax is just so much cleaner than Java (Processing).  I also looked closely at XNA, but approaching C# doesn’t give me any great joy, based on its structural similarities to Java.  There is a huge XNA community, and I’ll probably come back to at during some point.  I also took a serious look at Blender, and its game creation system.  But since I’m so used to Maya as my DCC tool, switching to Blender was really hard.   You can’t change the hotkeys!  It’s just too much for me :)  Maybe when version 2.5 comes out…   So for now,  PyGame FTW!

I have picked up some books on the subjects to supliment the vast quantity of tutorials on the web:

PyGame:

XNA:

And while I was at it, got one on the Arduino, since you never know when that will come in handy 😉

I’ve already got a simple 2-‘player’ game up and running where you can drive two ‘tanks’ around the screen.  A pleasing start.

On a side note, my Xbox 360 got the RROD last night.  Sigh…

First project with the Arduino

While at the ’09 Maker Faire I picked up an Arduino Duemilanove.  What is that you ask?  From their site:

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).

Since I dabble in Processing, and the Arduino always seems to get spoken about in the ‘Processing circles’, I figured I should give it a shot.  What I find ironic is the Arduino was about $35.  The USB cable I picked up to hook it to my computer was also about… $35.  Sigh…

Though once I downloaded the software and decided to give it a shot, it was surprisingly east to get going.  Since the Arduino language is based on Wiring which is based on Processing, and they share the same IDE, at first glance the programs are a snap to understand (if… you know Processing that is). And if you have a few spare parts laying around (LEDs, resistors, etc), you can have some geeky-goodness running in no time.

The below images are from their ‘Loop‘ example.  I have a movie of it blinking over on Flickr (can programming an Arduino, but still can’t figure out how to give video on my blog…).  Click on the pics to be taken to pages that let you see bigger images.

dsc03787dsc03790

Processing in Eclipse

I think that Processing‘s default IDE, the PDE, is pretty accessible to the new programmer.  I’ve had a lot of fun with it.  But since Processing is based on Java, it could be presumed that it could be authored in a Java IDE.  And indeed it can.  Via the processing site, there is a tutorial that walks you through the process of setting up a simple Processing sketch inside the Eclipse Java IDE.  Why would you want to do this?  For me, mainly code reuse:  The PDE doesn’t allow for a lot of easyconvenient code reuse:  Say you make a particle class in sketchA, and you want to use it in sketchB:  You’ll need to physically duplicate the code inside of your new sketch.  Ouch.

After completing this excersize, it just makes me realize how little I know about Java!  But I think Eclipse is a great place to start learning it.

processingeclipose