Mwa ha ha! Cower in fear puny mortals! The realm of the dead has burst upon your world and nothing is safe!
This movie requires Flash Player 9
Tags: as3, fall, halloween, leaves, special effects
Category Flixel Showcase |
Another ‘seasonal’ special effect! This one’s (obviously) about fall
This movie requires Flash Player 9
There’s several things going on here:
- First, the tree and it’s leaves are all randomly generated. The tree is comprised of “TreeBits”, which are 1×1 black FlxSprites with a ‘weight’ assigned to them. These are placed in the area around the top of the trunk randomly, but slightly denser towards the middle mass of the tree.
- The leaves are placed on a layer on top of the branches. These are also 1×1 FlxSprites with a random color assigned to them, and a random weight (but much lighter than the branches). These are scattered all over, and a little outside the area of the branches, and then several are randomly placed just above the ground.
- Some of the other graphics are setup including the background, and the very, very subtle mist layer in front of everything else. These are the only 2 ‘external’ images used – I didn’t feel like messing around with gradients in code.
- The wind is set to be randomly blowing somewhere between -10 and 10, and it’s ‘goal’ strength is randomly set within the same range.
- Then it starts running: the wind will gradually increase or decrease until it hit’s it’s ‘goal’ strength, and then it will be assigned a new random goal. So the wind will always be gusting and it might increase or decrease or reverse directions.
- Each of the individual leaves in the tree will be sent a ‘push’ command, with the current wind strength and direction. Based on the leaf’s weight, it will move a slightly random amount in the direction of the wind (it might not move at all). Fluctuations are built in so they’ll look more like they’re flailing back and forth. The same thing happens with the branches, but they weigh more and so move less with less fluctuation.
- If a leaf is pushed to it’s limit, there’s a random chance it will break away from the tree and start falling. Falling leaves are simply pushed a slightly randomized amount based on their weight and the wind, with some up/down fluctuation, and a little side-to-side fluctuations. Branches won’t break off.
- Falling leaves don’t collide with anything except the ground, or leaves that are on the ground. Once it collides, the leaf gets marked as ‘on the ground’ so that it can collide with other leaves.
- Leaves on the ground that do not have a leaf directly above them can be randomly picked up by the wind again. It takes a little more force from the wind to pull them off the ground than out of the tree, and it’s randomized.
- Besides the leaves, there are also little wisps of dust or particles being pushed by the wind. These can randomly appear just off the screen if the wind is strong enough in either direction and fly quickly across the screen with some variant in their up/down movement and opacity. If the wind slows down enough, they’ll disappear.
- To top it all off, random ‘ghosts’ will appear from the ground, fade in and then fade out again with some randomness in their y velocity and some side-to-side movement. These ghosts are made up of individual blocks of FlxSprites that change their opacity separately depending on the Sprite above’s opacity.
- Also, the leaves on the tree are finite. If you leave it run long enough, the tree will be bare. Leaves that enter from off the screen are infinite.
And that’s it! I had fun playing with this, and I would like to make many more in the future
Let me know what you think!
You can take a look at my code to see how I’m doing things:
(more…)
Tags: actionscript, actionscript 3, as3, chaos, code, cool, demo, demonstration, effect, effects, flash, Flixel, fx, neat, random, samples, source code, special effect, special effects, tricks
Category Flixel Showcase |
In an effort to retain at least some of my sanity, I spent some time just goofing around with Flixel and came up with something that I think is really neat.
This movie requires Flash Player 9
Not sure why I always seem to like playing with snow
There are several different subtle things going on all at once:
- First, it only snows at night, and it starts out with a few fewer flakes and then builds up until the night is almost over before slowing down a bit.
- The snow flakes are all affected by the wind, which randomly, gradually changes speed and direction throughout the night.
- Flakes can land on the ground or land on other flakes on the ground and build up over time.
- When the sun comes up, it starts to melt the snow that is at the top of the drifts, randomly melting more and more snow the higher the sun gets in the sky.
- The snow will start to melt, and then turn to water, and no longer collide.
- Any water that has not completely run away will refreeze at nightfall, becoming solid again.
If you’d like to know a little more about the technical side of things, or would like to see the source code:
(more…)
Tags: actionscript, actionscript 3, as3, chaos, code, cool, demo, demonstration, example, flash, Flixel, fx, melt, neat, random, snow, source code, special effect
Category Flixel Showcase |
In our upcoming project, we’ve been playing with some effects using BitmapData.copyPixels and came up with a neat displacement effect. Here’s what it looks like:
Update: “Shockwave” effect added. Click the mouse to see it in action!
This movie requires Flash Player 9
(more…)
Tags: actionscript, as3, classes, code, displacement, download, effect, Flixel, free, fx, special effects, tricks
Category Flixel Showcase |
The Tile Isle crew has been hard at work on a new project and we wanted to show you a little bit of what we’ve been working on.
We’re still using the Flixel framework, and we’ve added some of our own tricks to add some awesome effects.
We’ve had 2 talented people join the team: Ryan Malm has been working on the code and coming up with some great stuff, and Kari Kuukasjärvi who has been working on concept art.
Over the coming weeks, we’ll be talking about and highlighting some of the features and effects we’ve implemented. Stay tuned!
Tags: code, effects, Flixel, news, samples, site, upcoming, update
Category Games, Site |