'Flash' tag

Sunflowers, Spirals, Flash

0

Recently a project came up that had the potential to use an abstract sunflower as a lovely motif. After looking into it a bit, there happened to be an equation describing the arrangement of seeds in a sunflower. The equations looked fairly straightforward, but I’m no math wizard and had no idea to figure out the x and y coordinates of the ‘seeds’, but lucky for me I happen to sit across from someone who knows what the hell they’re doing and as a result I have a simple sunflower generator:

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Read the rest of this entry »

Jump Around

0

I’ve been tinkering with Sprites and the idea of making a silly little game in Flash with AS3, to flex (PUN?) my actionscript chops. This is the meagre progress I’ve made so far, and I thought I’d make it open source for all the world to gasp at my horrendous code. I’m currently at the “HOLY CRAP I MADE A CHARACTER THAT CAN JUMP USING AS3″ stage of development.

How about that linear jump? Needs some gravity love, eh?

Get Adobe Flash player

SOURCE (71 KB, .zip)

You might have to click on the swf to give it focus and enable keyboard controls to move/jump. Shift+Left/Right to ‘run’ (*his legs don’t move*). No collision detection whatsoever, yet.

Below is the event handler I’m using for jumping, which is called on every frame after the user presses the up key, until the jump is complete:

private function jump(e:Event){
   
    var jumpDestination:Number = groundLevel - MAX_JUMP_HEIGHT;
   
    // only attempt to stop the jump if you've already left the ground
    if( inAir && y+height == groundLevel ){
       dy = 0;
       groundLevel = 0;
       inAir = false;  
       removeEventListener(Event.ENTER_FRAME, jump);
       return false;
    }
   
   if( y >= jumpDestination ){
        inAir = true;
        dy -= 4;
    } else if( y <= jumpDestination ){
        dy += 4;
    }
   
}

Eh? Eh? I felt good after figuring that one out. Ahaha. Looking at it though, I think I should be stopping the jump based upon some collision detection. As it stands right now, it wouldn’t work if you wanted to jump onto something (since it will only stop the jump if you hit the point you’ve started at. Development is early, what can I say.

Flash Flash Everywhere

0

I would by no means call myself anything more than a ‘novice’ at programming with Actionscript; it’s not something I have volumes of experience in, outside of the program I took in college. I swore I’d never work on another Flash project after my last class, and a couple weeks later I was at a 3-day Flex training course.  To continue the trend, I’ve been doing quite a lot of Actionscript (3) at work for the past month or so at work, making interactive maps (eep!) — I’ve been called ‘the map guy’ by some because of it.

HENCE ALL THE ACTIONSCRIPT 3 RELATED POSTS.

Indeed, I had set up a separate blog to keep track of the little nuances/annoyances I learned (and that I’m still learning!) while reading and programming in AS3. Then I realized it was a waste of time to maintain another blog and promptly merged it with this one. Funny how things work out … 

Flash Pixelshift Bug

0

Flash apparently has a thing with cutting off .pngs. Putting the graphic element in a movieclip with a bottom right alignment seems to solve the problem, as per here:

http://www.fatorcaos.com.br/flashimagebug/