User login |
JavaScript proxy for ActionScript 3I find the syntax for calling JavaScript functions from ActionScript to be awkward at best. Consider the following JavaScript: function handleClick(source) { // stuff } var Library = { processOrder: function(itemID, quantity) { // stuff } } The standard way of calling these functions is to use ExternalInterface: ExternalInterface.call("handleClick", "mainPage"); ExternalInterface.call("Library.processOrder", 51829, 3); I find the following syntax to be preferable: JS.window.handleClick("mainPage"); JS.window.Library.processOrder(51829, 3); Source code of the JS class that allows this syntax follows:
Merging XNA and WPFEdit 11/17/2010: While this article’s XNA+WPF solution worked when I wrote it, in mid 2009, it no longer functions. This solution might get you halfway there, but I have not researched the other half as I am no longer regularly programming in XNA. The comments contain some other solutions to the problem at hand.
4k Dungeon Romp takes 2nd!
Dungeon Romp 4k has taken 2nd place in the Flash 4k Games Competition. I’m pleased with the result and have resolved to buy a 3D Math book with the winnings so I can further the full version along. :)
Dungeon Romp -- full version feedback previewEarlier, you saw my 4k dungeon game. I’ve been working on a “full” version — here’s where it’s at so far. Known bug — walking can get wonky if you’re next to a wall. Dunno what the cause is — it goes away if you run Flash in a debugger. I’m working on it.
Four kilobyte gameHere’s the final version of my 4k game competition entry. This game is a homage to the early dungeon crawlers, like Wizardry, Might and Magic, Bard’s Tale, etc. It’s not quite as fun, but most of my space budget is taken up by Flash bullshit and maze generation unfortunately. Still, you can wander around, kill stuff, and watch various numbers go up, and really, isn’t that what these games are about? Arrow up moves forward, arrow down moves back, arrows left and right rotate you respectively.
o2d -- a two-dimensional game engineThis engine was my senior thesis in school, and a hobby before that. It started out with me wondering if I could reimplement RPG Maker XP in Java, using open-source libraries. Turns out I can, and I did enough of that to satisfy me. Java was too slow (or, more appropriately, I didn’t know enough to write it efficiently in Java), so I ported it to C++. The C++ port done, and a variety of scripting languages embedded and removed, I got bored and starting reimplementing it in a variety of languages as a learning tool. I did Python, Ruby, and later C#/XNA. When I got my first Flash job offer, I decided I needed a portfolio piece, and this engine seemed a good enough choice.
Brevity in conditionalsI see a lot of constructs in code that are just wordier than they need to be. All of these examples are in ActionScript 3, though most of them apply in other languages as well. Many of these are also marginally faster than their wordier counterpart.
Dreamhost SVN catastrophic failureI did a stupid thing. That said, I was using an idiot-proof web interface and it let me do it, so I figured it was cool. I wanted to password protect subdirectories within my Subversion repository. Accepting from the beginning that this isn’t possible in the literal sense, I went for the next best thing — making repositories mapped to what appear to be subdirectories of the base repository.
New house picturesI recently signed a purchase agreement on a new townhome — I should close on October 7th and move in as quickly as possible afterward. I snapped some pictures of the model home, which is exactly the same floorplan and basically the same options as my in-progress place, and I also took some pictures of my actual unfinished joint for good measure. Have a look, if you’re curious.
Making friends with binary representationThis post is inspired by Nick’s aversion to bitwise operators all over the place. Despite this glaring personality flaw, he’s still worth hiring. Many developers, and unfortunately almost every Flash developer, are far too comfortable with their abstract data types like
|
Recent blog posts
|
Recent comments
2 weeks 4 days ago
6 weeks 15 hours ago
19 weeks 4 days ago
38 weeks 3 days ago
40 weeks 6 days ago
42 weeks 2 days ago
44 weeks 3 days ago
1 year 7 weeks ago
1 year 11 weeks ago
1 year 14 weeks ago