Wednesday, December 10, 2008

Arrghh...

Yeah Arrghh***Just about had it with this damn blog.

Seems like everytime I try to reconstruct this thing something goes haywire and the result is I lose all my links, files dissapear, posts morph into zany fonts, so and and so on with the result being I end up with a head-ache. Ah bollocks to it, my old man would say. I will get round to getting the old demos back up there sooner or later but please bear with me, there are hot young Japanese girls that take up my precious time being taught English most of my daily life, and a few hours a night is about all I ever get for the personal stuff.

Saying that, at least the SplatterHouse tutes are up, those are the ones people ask for..and hey, on the subject of tutorials, let's talk for a bit..
Once I'm done with BH2 (or get sick to the back teeth of it) I will write a few Dumbies Guide To- style sections on AS3 game programming. I have noticed, as some of you have, that there really aren't enough decent ones out there on the web as of yet. A couple of good ones by 8bitJeff and not much else.

People get all baffled by talk of Object Orientated coding, Classes, encapsulation, polymorphism etc. and give up since there are no easy to understand tutorials out there for them to get to grips with. And it seems that those members of the Flash fraternity out there that can actually show noobs how to code in OO feel that it's too complicated and that they should really get their heads around AS2 first. In a sense I agree but what most peeps don't realise is that it's very feasible to code AS3 in a manner similar to AS2 without delving too deep into all that and still get everything AS3 has to give. Why bother learning AS2 only to have to relearn AS3? To my mind that's like taking driving lessons to charter a yacht. I'm not saying you shouldn't get round to learning OO one day- as naturally OO is the best way to code- BUT I'm thinking there are a lot of guys/girls out there who just want to make GAMES, have the hardcore perseverance to get over that barrier, but would rather dip their feet in the water before diving it first.

Once you understand all the AS3 programming methods for say, whipping up a physics engine, it's far easier from there to approach OO and converting that code piece-by-piece, figure out the necessary OO relative to their own projects- that's my theory anyway. Kind of a hands-on-approach, learn by doing type of education. Exactly how I teach English as a matter of fact.

So, when I have the time I'm going to endevour to rewrite one of our favourite classics of 80's-90's. Right now it's a coin-toss between Green Beret or Vigilante. They're both simple games to code (in theory), and yet feature some elements that most coders would want to study ; 4/8 way scrolling tile-engines, climbing ladders, fighting bosses, spawning multiple enemies with assorted health/energy, sfx coding, so on.
I could see how a tutorial could highlight all the aspects of games programming I want to share, and hopefully signify the end of AS2 games that crash my browser and meltdown my hard-drive.

Watch this space!

p.s.The BH2 demo has been updated, hit up the link on the post below to see it. Not so much done, ships now form a fleet and move towards a target. The leader can be destroyed and automatically another ship in the group will be designated as the new one. When clans meet they don't do much, just find themselves an enemy and circle around each-other. Decent AI has not been written yet, and shoot too many of the ships and you'll get them wondering off in weird directions as the code for them to auto-assign to another target from the now non-existing one has also not been done yet.

Wednesday, December 3, 2008

Update-Updates

Some minor changes made to the Bounty Hunter demo.
Doesn't look like much on the surface but there's been quite a lot thrown in there behind the scenes.

CHECK IT OUT HERE

DON'T SHOOT THE LEADER though! There's no code to take care of what happens code-wise for the other NPC's after the main NPC clip has been removed. You might crash your browser due to null references.

Enemies can now be spawned as a clan/team. The properties of all the sprites are stored in objects and can all be referenced to each-other like a linked-list. When a new clan is generated a random member is designated as the 'leader' (and given a Glow filter) and the others will follow their boss at a set distance as if they were parts of an IK chain. If a leader is eliminated another will crop up to take his place (not implemented yet). Leaders of clans will go towards a set battleground co-ordinate in space and when they're within a desired distance the AI will switch over to battle mode and they'll be able to scrap it out until all that's left is space debris. From a coding viewpoint battle mode means an NPC will randomly select an enemy from the opposing clan and war it out until somebody is dead. From then on the dice are rolled once more and another is chosen, and this goes on until the entire clan is wiped out. Theoretically you could have all the enemies gang up on one poor guy, though I met set the odds more in favour of you being the target. Obviously you can eject once you feel your health is about gone, but this will carry some vulnerablility being that your gravity suit can only go so fast, you'll require a host ship to takeover, and it'll be a one-shot-you're-dead situation.. Later on I'll likely make it so the astronaut can fire some manner of feeble lazer to give him a small fighting chance to weaken ships and make them boardable.

Your job will be to protect your soldiers from getting wasted- at the same time you'll have to net other more powerful ships just to keep yourself alive, or maybe to add to make your team stronger for the later stages.
Technically the game is not at the forefront of AS3 wizardry but so far everything has worked out the way I saw it in my head. Still got some funny bugs cropping up- such as when you try to board ships (-related to swapping depths I'll bet) but it's playable.

Starships have nice jet-fumes now. The more fume clips I add the better the effect, but unfortunately it was slowing down the action heavily and I had to forsake beauty for muscle in this case. Although the results of running some tests using BitmapData instead of mc's proved to give more speed I couldn't quite work out a couple of nasty untraceable errors I was getting at compile time, so for the time being clips will do...

Hey when you think about it, we're not a million miles away from a game here. It'd be nice to get this one wrapped up as I'm itching to get back to my fighters. That SORF demo is just begging to be made into a full game.

As for all the rest, I'm thinking to rewrap Trivia Casino with some more functions and send it out with my blessing amongst some more portals. It's not a bad quiz game after all, though it's not bringing me in a penny right now-in fact I've a theory the MochiAds code isn't working- my stats say 0 visitors in the past month..