Yesterday I promised my friend that I would help her with assignment to develop a platform game in flash. It only had to be simple but she was fretting about not having a clue where to start. I've not used actionscript before but have 'dabbled' in the flash environment a few times - without really knowing what I was doing. After a couple of hours however, I started to get to grips with the syntax of it all and we began to make some progress. We got the background moving and looping and the character was responding to the directional keys and the jump command.
The character was a skateboarder - primary to remove the need to make him walk rather than glide and the environment was to be a street / road. It actually looked quite good, even at this stage and we were so impressed with what we had accomplished so far that we had lunch. The one condition of my offer of help was that she would feed me and that was a challenge her mum rose to very well. A delicious cottage pie was on the menu for lunch and after a (slightly longer than scheduled) chat we got back to work.
As it turns out, the first bit was the easy bit and the other tasks were a lot more complicated to work out. We wanted obstacles for the character to spawn in random places on the road so that he would have to avoid them to continue on. About three hours later we finally got that part of that done and managed to get drink cans to spawn and move along with the background. The trickier part was getting the game to recognise these objects as 'solid' and it wasn't until much later in the evening that I realised that a bit of code that I saw earlier in the day held the answer. It turns out that this art of making objects solid is called 'collision detection' in flash speak and actionscript 3 has two very simple methods of doing this. All in all, about six hours of work turned into no more than about ten lines of code which is very very frustrating when you eventually realise how simple it is.
QI and the final instalment of the Story of the Noughties trilogy made up tonight's or rather tomorrow morning's viewing because it was 11:30pm before I got back to my house after trudging down the road in the snow. The plus side to this is that my brother discovered my walking boots hidden in the shoe cupboard. I thought I'd lost them after finding the empty shoe box as I was packing up to move house at the end of the last academic year and they make exceptional snow boots.
Friday, 8 January 2010
Getting Flashy
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment