Cool JS App: Treesaver.js

If you’re looking for a web-based flipbook that works great on iOS (and other Flash-less devices), take a look at treesaver.js. It’s an open source script that automatically builds properly formatted pages that swipe great on the iPad and look great, too. Since it’s stock HTML5 and JavaScript, it works great almost everywhere.

Lightweight and fast, the Treesaver.js app doesn’t add any crazy overhead to your content but putting your content into the system and making it look nice still requires quite a large bit of elbow grease. This is due, in large part, to the unfinished documentation on the Wiki.

But, the software is only at version 0.9.2 currently, so there’s plenty of time for the community to help out. I love open source software.

BastardBlaster Running on iPhone

Pretty neat! Still a few graphical glitches. Thanks goes out to my buddy Chris for the screens and test.

Play My Game – BastardBlaster

As of this posting it’s a very early version with still much of the stock artwork and enemy types. But, it’s fun and playable. Go Akihabara!

The story goes that you’re a BastardBlaster, conscripted to battle everything in the world that’s annoying. Flat tires, Blue Screens of Death, when you go to eat pizza and there’s none left… the list goes on and on. If it’s annoying, you shoot it.

http://arcade.xandorus.com

 

 

Took a break, had some tea, now I’m back to coding.

Ahh, refreshing tea from Bon The Place (my fav tea store, ever.)

Got the game working in Chrome since I decided to simply host it locally with Apache at localhost. Just makes thing simpler since Chrome seems to run the game a lot faster than Firefox (my laptop is a beat up piece of … but it’s still kickin’ so I really can’t complain, I guess.)

Will post more progress and I make some.

Serving JS Locally With Chrome Is a Common Problem

Turns out a lot of people are having the same issue with Chrome / Chromium and their extensive security. Not that I mind a lot of great security around JavaScript, mind you.

http://code.google.com/p/chromium/issues/detail?id=40787

Hopefully once the game makes it out to the web this will go away as it’s the same domain policy that’s causing problems.

Default Music Now In, Runs in FF But Not In Chrome

Got the game loading and playing in Firefox, but doesn’t even try to load in Chrome. I have no idea why. It seems I’ve spent about twice as much time debugging as I have developing. For this stuff to work, that has to change.

I’ll reiterate: Chrome NEEDS a javascript error console! (or am I dumb and I just can’t find it?)

“Not Well Formed” Is a Red Herring

I couldn’t figure out why my HTML5/JS Akihabara game was not loading and thought the error in the Firefox JavaScript Error Console “Not well formed” had something to do with it. Turns out that if Akihabara cannot find the audio files for your game, it hangs on loading and there is no error in the console to that effect.

I threw the OGGs and MP3s in the directory and we’re off to the races. Still get “Not well formed” but the game runs. Who knows?

 

 

Adding and Removing HTML elements via JavaScript

Sometimes while developing a web application, you need to hide or display certain elements dynamically based on circumstance. For instance, if you’re filling in your personal information and you in the dropdown box you select “other” as your country, the website may be required to display a previously hidden textbox allowing you to type in your country name.

This post contains two links, written by the same person at two different times. Which one you choose to use is completely up to your skill and the scope of the project you’re working on. The first, is a simple, easy-to-understand Javascript code snippet: http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/

The second link is a reprise by the same author almost three years later with a much cleaner implementation of the same functionality in JavaScript. Unfortunately, it requires more knowledge about JavaScript and events, and for a beginner in programming, the first link may be easier to swallow. For the site, click this link: http://www.dustindiaz.com/add-remove-elements-reprise/

Pick your poison :)