Tues 6th May: Projects Night I

May 1st, 2008 by rtf

FlashBrighton’s members and their enthusiasm for volunteer projects are its lifeblood. We’re so proud of these shining stars that we’ve decided to give them ONE WHOLE SESSION A MONTH EVERY MONTH to keep up us all up-to-date. The first session of every month is now given over to discussions, presentations and all-things-great about the various projects our members are running and as next Tuesday is the 6th of May… well, I’m sure you can do the math. Tuesday 6th May is the first of many sure-to-be-awesome-you-damn-betcha FlashBrighton “Project Nights”.

So, what we dun got? Well, first and definitely foremost is Joe “LegoJoe” Chung’s insane “Robot Wars” quest. What can we say about it that we haven’t already said? Not much, especially considering that we’ll almost certainly be writing about it again real soon - like, I dunno, the first session in June, maybe… and July… and… yeah, you get the picture - so we better not waste all our entertaining hyperbole on it here. If you HAVE been holed up in darkest Penge for the past few months and have no idea of what we’re wittering on about, you can catch up with developments here, here and here. Joe will be in attendance to bring us up to date with all the late nights he’s had up with it recently and, no doubt, a record of all the Red Bull™ he’s got through. Come along for the count, do.

Secondly, you can have a good old gander at all the smashing bits and pieces that have come out of the somewhat less geeky “Dictionaryville” project too. Again, if you wanna catch up on what that is, try this exciting link. Less Red Bull™, less ActionScript too probably, certainly a lot less collision detection but a lot more Chinese WWII P.O.W. admin forms, we can guarantee you that.

Intrigued? Well, there’s one really good way of slaking your curiosity: by…

REGISTERING FOR THE SESSION ON UPCOMING NOW AND GIVING YOURSELF MORE FLASHBRIGHTON RAFFLE TICKETS IN THE PROCESS !!!

AS3Bots - Round 2

April 30th, 2008 by LegoJoe

Taking a step back, I’ve re-implemented the game to be a simple event driven system. This was done in the interest of keeping things simple and having the ability to show the progress of our decisions. Most of you will be able to look at the code currently and forsee what problems we will face in the future. In a real production environment we would factor in these problems during the analysis phase, but in the interest of education we will implement every step as we go along.

There are two classes only, Game and Bot. The bot dispatches events when it wants to move or rotate. The game listens out for these events and acts accordingly. Simple!

When a bot wants to move, it stores the amount it wants to move in a public property that is accessible to the game. It then dispatches a custom ‘move’ event to let whatever is listening know that it wants to move.

public static const MOVE:String = "move";
public var amountToMove:int;

private function move(amount:int):void
{
  amountToMove = amount;
  dispatchEvent(new Event(Bot.MOVE));
}

Note, there is code in the Bot constructor that sets up a timer that calls the move and rotate methods every second for three times. This is just a test to see that the game can pick up the events.

The Game’s init() method sets up a new Bot and listens out for its move and rotate events.

private function init():void
{
  addEventListener(Event.ENTER_FRAME, mainLoop);

  _bot = new Bot();
  _bot.addEventListener(Bot.MOVE, moveBot);
  _bot.addEventListener(Bot.ROTATE, rotateBot);
}

When the bot sends a ‘move’ event, the game fires its moveBot() method.

/**
 * Moves a Bot forward or backward.
 */
private function moveBot(event:Event):void
{
  var botToMove:Bot = Bot(event.target);
  trace("Move bot " + botToMove.amountToMove + "px");
}

This method gets a reference to the bot in question via the event’s target property, from where it can access the amountToMove public property that was set by the bot.

If you run the code, you will see that 6 trace statements are made (3 x move and rotate). What we want now is to be able to see this happening with real sprites. The first step is to have the Bot class extend Sprite, but how do we do this if the class already extends EventDispatcher? Suggestions here please, and the best one will get incorporated into Round 3.

Update:
Sprite is a subclass of DisplayObject, which in turn is a subclass of EventDispatcher. - Thanks Toby Ashley.

AS3Bots - Round 1

April 26th, 2008 by LegoJoe

AS3Bots is a collaborative project similar to Robot Wars, but with Flash. More details can be found at http://code.google.com/p/as3bots/

I will document my thoughts and findings here, during the course of this project, to keep everyone involved up to date. Perhaps those learning object oriented programming may also find this of use.

To start I created the main class - the Game class, which contains the main loop for the game. Originally I thought the coding of the bots would be quite freeform - flexible enough to make it do anything you want, but this isn’t feasible. Akin to the laws of physics defining what the bots in Robot Wars can do, we’ll have the game handle what our bots can do. A bot will ‘ask’ the Game API what action it wants to take and then the game can decide if the action is allowed.

At first, I created the Game class with two public functions, moveBot and rotateBot. The idea was to have the bot request an action by doing something like game.moveBot(this, 5) - asking the game that it wants to move 5 pixels forward. The game would pick up the command, do some checking to see if the bot is in a position to move, and only after then would it actually move the bot. The ‘competition’ would be in calling these commands at the right time in the right situations.

The basic Game class works fine with just two commands, but I could already see it becomimg unwieldy if we had tens of commands. And how will it work if we had several people coding lots of commands? They can’t all work on the one Game.as file… So I came across the Command pattern. This design pattern “encapsulates functionality into a class” (Lott and Patterson) - brilliant - we can freely code new commands for the bot without the worry of breaking something. I’ve created a simple interface called ICommand. All commands will implement this interface, which ensures simply that all commands have an execute() function. Using the Command pattern also allows the queuing of commands, for example if a bot requests several actions at one time, the game can execute them in sequence at a particular time.

The next logical step was to extract the moveBot function out of the Game class and into a new class called MoveCommand. Easy! But how does a bot request this command now? If the bot can only communicate with the Game API then the moveBot function will need to go back in the Game class, but with code to create a new instance of MoveCommand.

Now my original problem has reared - a new command will need a change in the Game class. Is there a way to decouple the commands from the Game class, yet allow the bots to use them?

Tues 22nd April: Drawing Dictionaryville

April 18th, 2008 by rtf

Sometimes you could be forgiven for thinking that Flash was all about one thing: ActionScript. But, kids, illustration: remember that? Fills, strokes, vectors: anyone? Sure, we’re all AS3 gurus, great, but can you remember how to draw, what colour compliments red, where your sketchbook is? Come on people, we’re losing focus here: there’s a whole nuther side-of-the-head we could be using. Let’s unpack the pencils and draw!

Tuesday 22nd April FlashBrighton is going to launch ‘Dictionaryville’ a cute-little-illustrative-sister project to accompany LegoJoe’s awesome-big-bro-coding ‘Robot Wars’ adventure.

Dictionaryville: a town where every citizen is a word from the dictionary. For instance, at 101 Lexicon Lane lives ‘Magnanimous’, husband of ‘Analogue’, father of ‘Indexical’ and neighbour to ‘Zenith’, ‘Begonia’ & ‘Inopportune’. Nattering at the local flower shop we find ‘Intrigue’, ‘Mayhem’ & ‘Bap’. Patrolling the streets, officers ‘Granite’ & ‘Lampshade’. On the number 37 bus into town ‘Jam’ chats to ‘Pertain’ about the weather whilst ‘Attentive’ scrawls intricate graffiti on the back seat and the driver ‘Bulldozer’ bruises crudely through rush hour traffic. What are these characters like? What do they look like? Where are they going? What dramas, tribulations and absurdities do they encounter? And what about the town itself?

Those are just examples though, the Dictionaryville project is completely open-ended and the April 22nd meeting is an informal get-together to discuss what it will become, which could be anything from a simple one-off character creation exercise to… who knows?

So get out your pencil sharpener and sign up now for cartoony-looniness!

Remember, if you don’t sign up on Upcoming you don’t get no extra raffle tickets!

http://upcoming.yahoo.com/event/491762

Tues 15th April: Collision Detection Masterclass

April 12th, 2008 by rtf

Collision Detection, here’s how it works: you get hit, it hurts, duck next time fool! But how about the small screen, virtual collisions: how can we detect those? When Player1 meets Player2 in a Flash game its critical that they don’t overlap, they should bounce, scrape and strike each other, just like real tough fightin’ guys. Detecting collisions isn’t easy but fear not, because on Tuesday 15th April you can come along to FlashBrighton and find out how at our Collision Detection Masterclass!

Here in Brighton we’re blessed with many experts of Collision Detection but none more qualified for this jamboree of frictious frisson than our own Seb Lee-Delisle. Seb’s made more MovieClips bump n’ grind off each other than you’ve had bad takeaway pizzas. He’ll school you in the basics and maybe more if time permits. You’ll be slicing up your Voronoi regions with your axis theorem in a jiffy-jaffy.

And all this is to take LegoJoe’s ‘AS3 Robot Wars’ project of a few weeks ago onto the next level. Said project - to produce a Flash-based variant of the popular BBC2 smash-n-crash TV show - will obviously benefit from a sprinkling of collision detection. Our very own Craig-Charles-Alike Joe will be in attendance to tell us how things are progressing and also to answer the question on everyone’s lips: Just when WILL we get a ninth series of ‘Red Dwarf, eh?!’*.

Register now to avoid disappointment. And guarantee the disappointment of others.

http://upcoming.yahoo.com/event/472625/

TIME, DATE & PLACE: 6.30pm, Tuesday 15th April, The Cricketers pub in Brighton’s South Laines

*- DISCLAIMER: Joe may not be in a position to field questions concerning the current or future status of cult sci-fi sitcoms.

Tues 1st April: AS3 Robot Wars!

March 27th, 2008 by rtf

Ladies, gents, let us take you back in misty time to August 2007. Back in those far-off days we, the FlashBrighton kru, came up with the idea of coding our own virtual bots and having them battle each other in a virtual arena. A kind of ‘Flash Robot Wars’, a lean, mean, screen-based digi-battle where everyone gets to create their own code-bot with AS3 and let it fight to the virtual death against everyone else’s. People said it couldn’t be done, people said it shouldn’t be done… some cruel souls even said it had already been done and put on the BBC years ago. But RITTLE-RATTLE-PISH to all that, it’s time for ACTIONSCRIPT 3 ROBOT WARS !!!

That’s right kids, load up your A.K, oil your chainsaw and open your copy of ‘Essential ActionScript 3′ at “Appendix XIIVIMCX: How to build a kick-*ss AS3 Fighting ‘Bot” cos it’s time to get in the virtual ring! One of the first things you encounter in said appendix is the interesting fact that coding an AS3 fighting bot will “greatly improve your skills in AS3, object-oriented coding practices and understanding of artificial intelligence“. That’s cool isn’t it? We get to be better coders, more intelligent and all-round good eggs by beating seven shades of virtual *&^% out of each other. FANTASTIC!

We were just about to book Craig Charles for the session when we got an EVEN BETTER OFFER. FlashBrighton’s own master of Kung-Sprite Joe Chung is going to run the show. The project is it’s infancy so at this early stage next week’s meeting is just a casual discussion about how we will go about coding and organising it all. So, if you wanna be influencing this kewl project from the start, don’t miss your chance and REGISTER NOW!

TIME, DATE & PLACE: 6.30pm, Tuesday 1st April, The Cricketers pub in Brighton’s South Laines

http://upcoming.yahoo.com/event/464921

Tues 25th March: Group Programming Session

March 20th, 2008 by rtf

Y’know, programming on your own is fun and programming in pairs is just fantastic but programming in a big geeky circle is JUST AWESOME, the true craggy peak of binary-orientated merriment. And, happily, still legal in most countries. And y’know it’s weird cos it’s been, like, just aaaagggees since we’ve done it: all sat round in a circle on cheap plastic chairs in a kinda coffee-morning-mothers-n-toddlers-focus-group type arrangement with a nice hot cup of tea and hacked the holy-bejesus out of an ancient console game. What ARE we thinking, let’s get it awhn and FLOJO!!! It’s a true group effort: one computer, a single objective, a buncha geeks all in a circle and every five minutes a new coder in the hot seat. Well, the lukewarm seat really, it’s hardly MasterMind or anything. As they say in progressive marketing circles:

“All levels of ability are welcome”

Come on kids, like the winter, the waiting is OVER! ActionScript Group Programming Session a-go-go! ‘Time to flo your jo, or jo your flo or loco your mojo or paco your rabanne or whatever. God, I dunno what you call it, I just know it’s time to get back on the board!

The keyboard that is; I appreciate that it’s hard to tear yourself away from charlieplexing your Arduino but there are other things in the world to do. Responsibilities guys, come on. I mean, have a look at this little thing I got here. It’s a cute little Flash Pong game that we left over-wintering in the darkness at the back of the shed. Anyone remember it? No? To be honest I wouldn’t be surprised if you didn’t, so little attention has the poor thing received these past few months. We were all so excited about it once, so intent on group-programming it’s basic little interface. What happened to those far off, care - not-to-mention hardware - free days? When did we lose our over-pixelised, two-tone innocence?

Look, we all need a bit of attention now and then, a bit of love and care. If we don’t get it we can get a bit… well, a bit smelly to honest, phewy! This here Pong here it… yeah, it’s not exactly the nicest thing around here at the moment. But it’s not it’s own fault, it’s just been a bit neglected that’s all. So come on everyone, let’s show little Pongy that we care, let’s get together next Tuesday and clean him up. Let’s - in short - FLOJO!

Like last week’s wires-all-over-the-shop hardware m’wash up we’ll need a little more space than usual to perform this majik trik on little Pongy so numbers will again be curbed, this time to the PRACTICALLY DESPOTIC limit of just 10, so book early and make sure you get a place! Run to get one! Scramble contemptibly over others to get one! Kill your best frie… actually scrub that - it’s good but not THAT good - but do make sure you get one.

OK, here comes the boring details bit. C U ther init yeh? Nice one!

TIME, DATE & PLACE: 7.30pm, Tuesday 25th March, The Cricketers pub in Brighton’s South Laines

Because of the Easter holiday REGISTRATION IS OPEN DIRECTLY at:

http://upcoming.yahoo.com/event/460474/

Tues 18th March: Arduino & WiiMote M’Wash Up

March 14th, 2008 by rtf

Now I dunno about you but i just LOVE Flex. Ever since I saw that guy with the wild eyes and the bird’s nest beard do his whole “with flex… without flex… any questions?” thing I’ve just been, like, just CRAZY about Flex 3. I can hardly stop myself instantiating new AdvancedDataGrid components. But… well, I’ll be honest, I mostly went along to the Flex 3 party ‘coupla weeks ago because I wanted to win an Arduino board.

Maybe you didn’t know, maybe you couldn’t make it, but thanks to the generosity of Adobe and the tireless work of Jo Summers we had 8 of these badboys to give away. Were you there? Did you get one? Did you get one and then graciously give it back because your boyfriend already won one? Did you get one because someone who’s boyfriend had already won one gave hers back? And if so have you made any cool sh*t with it yet? And if not WHY NOT considering that some of us who work bloody hard to make FlashBrighton just a magnificent success for you all DIDN’T GET ONE!

Not like I’m bitter or anything. It’s just… man, just look at all this great stuff you get with them. Like, diodes and switches, how cool is that? And… uh, knobs and um… uh and… yeah, other stuff. Like this… thing. Dunno what it does but it looks nice. Hey look, USB cable, just *IMAGINE* what you could do with that! So apparently the idea is that, and I quote, “it can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators”. Cool, connect it all up, stream your bits, get yourself some raybans, before you know it’s time for your Eno collaboration.

Whatever. I’ve no idea what it all does but I’m damn sure I’m gonna find out. And so can you, because as well as being my birthday Tuesday March 18th is also FlashBrighton’s Arduino Mwash-Up night bwoy! If you got your hands on one of these - or even if you didn’t - and are just *DYING* to know what you can do with it, come along and let our grandmasters of the board put you in check. We’re not really sure what we’re gonna be doing or who’s gonna be doing it but that’s half the fun. Some of us have got these babies *DOWN* and they can show the rest of us what they’ve done so far and how the whole shooting match holds together and everything. It’ll be sketchy, hacky, bit-y and just loads of fun!

AND WAIT… COS THAT’S NOT ALL!

That’s right, hack fans! If that wasn’t badly planned enough we’ve got even more making-it-up-as-we-go-along fun in the form of WiiMote sensai Kyle E. Jennings. Fresh from the University of California, Berkeley, Kyle is an expert in interfacing Wiimotes and Flash using the Wiiflash API, a technique which connects to a native application that interfaces with the Wiimote via Bluetooth. Apparently this gives you all sorts of exciting inputs, both from the ‘mote’s and nunchuk’s accelerometers and from its IR tracking. Crikey!

Kyle is kindly going to show you an application that… does all that stuff I just said, and will point out what others have done and what future possibilities exist. In keeping with the hacking theme, if you have a Wiimote plus a PC* (that can do Bluetooth) or a Mac** are encouraged to bring them along and mwash along with the mwastah! It’ll be like seeing Hendrix on the Isle of Wight. How will you tell your kids that you were at home doing the washing up when they ask you, a few decades hence, what you were doing whilst K. E. Jennings was rockin’ the Cricketers?

Seriously, are we not good to you? Where else are you going get a free Arduino, then free instruction in how to use it all washed down with a vintage WiiMote masterclass from a Berkeley Ph.D student? I don’t know the answer to that question but I’ll bet you a pound that it’s: NOWHERE!

Once again kids, best register to avoid disappointment. Places are very much as-per limited so don’t delay, register today!

TIME, DATE & PLACE: 6.30pm, Tuesday 18th March, The Cricketers pub in Brighton’s South Laines

http://upcoming.yahoo.com/event/452523/

*- If you wanna do this on a PC, go to wiiflash.org and download everything you need first.
**- If you have a Mac, Kyle will give you the Wiiflash server he wrote when you arrive.

Tues 4th March: Flex 3 and AIR Launch Party!

February 28th, 2008 by rtf

Well blow me, that was FITC Amsterdam eh, wow! Blimey, if you wanted your creative mind blown you had Jared, Natzke and loadsa people called Joshua. If you were wondering just how amazing code could be you had Andre Michelle, Ralph Hauwert and some english guy called Jeb or Zed or something to show you. Plus, three great parties, two free bars and one truly astonishing performance by the awesome, nay transcendental, supergroup “Phlash5″. Please, just take the word of someone who had a front row view: there are two types of person in the world, those who have heard Aral Balkan sing “Papervision Saved My Life” and those who haven’t. All that and I haven’t even begun to gloss over the pancake lunches, ferry strikes, pink elephants, accessibility experts careering in at 5am everyday, and ridiculous 24hr 60-channel snail-brain data-visualisation coding marathons that happened.

All that, and still, somewhere, quietly, humbly, amongst all the mayhem, Flex 3 and Adobe AIR slipped out onto the market.

I… did we miss that? Or were we just too drunk to notice? Well, if we did it’s no matter, because back home here in Brighton we’ve our own little Flexathon organised to celebrate. Flex is 3, and the little fella is growing up so quickly he’s got a new little sister in AIR to celebrate with. Come help us wet the babies’ heads with us, Tuesday 4th March. Like Willie Nelson, “I’ve got a long list of real good reasons” for you to be there. You wanna know what we’re gonna be talking about with Flex 3 and AIR? OK, deep breath now…

FLEX:

Open sourcing Flex
Introducing BlazeDS: open source HTTP-based messaging technology using AMF3
Flex major themes, including designer/developers workflows, working with data, hybrid desktop/web apps & framework evolutions
Integration into CS3, including simple asset skinning, making flex components in flash cs3 & datagrid & charting improvements
Addition and plugins, including ILOG Elixir components (treemaps, graphs), web services introspection, introductory data wizards & combining flex with air
One-off download for the Flex framework
Javascript/AJAX wrappers
Plus a whole bunch of smaller improvementrs

AIR:

Desktop functionality, data access to the filesystem & development through a local database
Broad platform reach across Windows, Mac OS & - eventually, hopefully - Linux
Build upon proven tech of Acrobat, Flash player & HTML
Support for build in HTML/Javascript or Flash/Flex
Universal AIR installer (win/mac) with signed, secured applications
Some mindblowing sample AIR apps such as Nicolas Lierman’s Google Analytics displayer
Inclusion of HTML open source rendering engine WebKit
Custom chrome and transparency apps
Synchronous and asynchronous data loading

…Phew! To show all this off to you we’ve got some official presentations direct from the ‘Frisco source plus some of our very own FB members talking. And… well, we’ve also got some GA-REAT swag to raffle off. Now I don’t wanna let the cat outta the bag prematurely but… yeah, let’s just say Adobe have, yet again, been very generous. They’ve given us a fat brown envelope and a coupla mysterious packages all marked “DO NOT OPEN UNTIL TUESDAY 4TH MARCH 2008, 6.30PM, THE CRICKETERS, BRIGHTON”. ‘Could be a letter bomb or ‘could be something even better than that! Like, can you imagine?!

Well, if you don’t get over to Upcoming and register for the event uber-pronto, then you aint gonna find out. Remember kids, places are limited and if your name’s not down, you’re not coming in. And if y’all don’t come in y’all don’t get to hear about the pink elephant neither. Or the speakers’ chocolate brownies. Or the $1 bet with Joshua Davis. Or…

http://upcoming.yahoo.com/event/443408/

Tues 19th Feb: Framework Development

February 15th, 2008 by rtf

Frameworks: what the hell are they? Supposedly they’re, like, logical plans and patterns you use to structure your code in a sensible way so that your development process is scalable, agile, robust… but like, what does all that abstract talk actually MEAN? Do you just, uh, put your IInput in, your IOutput out, coordinate your Strategy pattern and shake it all about? Or… what?

See, this whole RIA object-orientated application architecture, uh, rich, um, development leaves my head in a spin sometimes, and I haven’t had time to write a BrainSpinManager class that will cool it all down. I’m still recovering from counting all of lymnaea stagnalis’s 20,000 neurons, let alone thinking about the best way my Model can talk to my View or what the hell to blazes my Controller actually does when’s its at home. Or even when it’s away with “der fairies an der leprechauns, to be sure”, come to think of it.

But no matter, cos here come two dashing cavalry officers of Framework development to clear the whole thing up and help us ALLLLLL out, hurrah! Our own favorite US export Chris Korhonen and PureMVC maestro Neil Manuell ride to the rescue with a double-headed session about: Frameworks. A couple of hours in their robust, well-structured company and you’ll be the talk of RIAville.

Christopher - our man from some-company-or-other, not sure which - will kick the evening off talking about some of the concepts behind frameworks and core design patterns such as MVC. He’ll tell you how and why they can make application development quicker, easier, simpler and cheaper! As part of this he’ll revisit, review, criticise and appraise some £5 app type frameworks he’s developed in the past. Then, after the half-time oranges, Neil is gonna run you through what is quickly becoming one of the most if not theeee most popular free one-size-fits-all open source AS3 frameworks the global-hyper-web has to offer: PureMVC, the “lightweight framework for creating applications in ActionScript 3, based upon the classic Model-View-Controller design meta-pattern.” Like, architecture-tastic dude!

Basically, if you develop flash apps, these guys are gonna make your job 107% muchly better! Sign up for MVCIA2BBCTV fun NOW! SPACES ARE LIMITED, please register on our page on Upcoming to ensure your space.