Flash is Not Flash Player

To many users, “Flash” still is a browser plugin, but for designers, developers and creative studios, Flash has always been a rich animation/layout tool, as well as (for us ActionScript developers) a fast development workflow. The method of delivery has changed over time, but our demand for tools has not changed.

With the Flash CC Custom Platform SDK, using Flash for animation, layout and design is going to remain viable. I applaud Adobe for making Flash Professional more useful to everyone, since we cannot use Flash Player for all target environments anymore.

Take it from someone who has two legendary Snipers and a legendary Halberdier: the Sniper is useful in more situations. (I know you didn’t ask about Halberdiers, but they’re actually very similar to Icefang Huntresses. They have similar attack, health, and defense. They can hit multiple units in a line. They stun rather than freezing, but the result is similar.)

An Icefang Huntress works best at close range, but that leaves her open to retaliation. And she might be a tank, but no unit is strong enough to survive more than a few attacks in late-game levels. Range is far more important for survival.

I’m not saying the Huntress would be useless (among other things, her GB is amazing), but promote the Sniper first.

Because the mouse can move more than once per frame, you’d want the object to follow along so it doesn’t look like it gets left behind (imagine a very low frame rate, the effect is still noticeable at higher frame rates, but thinking about it from a “1 frame per second” standpoint gives an easy mental model).

Would Flash really redraw the object more than once a frame? MouseEvent doesn’t have an updateAfterEvent() function…

However, the hard part of coding – algorithm design – is still there. When designing an algorithm, you start out with nothing but an idea of what you want the computer to do. As a programmer, your job is to translate this plain-English idea into the steps needed to accomplish it. (Then you need to translate these steps into whatever programming language you’re using, but that’s easier once you get used to it.)

By way of example, let’s talk about one of my high school physics classes. I… didn’t always pay as much attention as I should have. When I got bored, I’d take out my calculator (because I didn’t have a smartphone), and I’d write simple programs on it.

In one class, the teacher was discussing acceleration, velocity, and position, so I got to thinking about those things. I decided to write a program simulating a ball moving around.

Acceleration is the change in velocity, and velocity is the change in position, and the screen is 2d, so I made six variables.
• Horizontal (x) acceleration
• Vertical (y) acceleration
• Horizontal (x) velocity
• Vertical (y) velocity
• X (position)
• Y (position)

I set horizontal and vertical acceleration based on the user’s input. Pressing left, for instance, set x acceleration to -1, and pressing down set y acceleration to +1 (because the y axis starts at the top of the screen, not the bottom).

Now that I had acceleration covered, I needed to move the ball. Since acceleration is the change in velocity over time, I added it every frame. (A frame is one unit of time, as you probably knew.)

Acceleration was never more than 1 or less than -1, but it added up over time. Next came velocity, which is very similar:

x = x + velocityX;
y = y + velocityY;

Then I wanted to make the ball bounce off the edges of the screen, because nothing in the above code stops it from leaving and falling forever. I did this by checking the x and y coordinates. If either coordinate was out of bounds, I forcibly positioned the ball back within bounds, and reversed its velocity:

if(x < 0) {
x = 0;
velocityX = -velocityX;
}

(There was similar code for the other three edges.)

After that, I decided I wanted the ball to slow down a little with each bounce, because otherwise it could get pretty insane:

if(x < 0) {
x = 0;
velocityX = -velocityX * 0.9;
}

I undid this change in the end, because I decided I liked the insane version better. In a real game, I would have kept it.

If you want to make games, you’ll have to get good at that sort of thing, and in fact you’ll have to solve much harder problems. There’s no programming language that saves you from this, nor will things like Stencyl.

The trick is to practice making algorithms until you start to enjoy it. It really doesn’t matter what language you practice in.

One thing to keep in mind: you don’t need perfect precision. Adventure Capitalist probably doesn’t store all 200 digits in your 10^200 score; it just stores enough digits that you can’t tell the difference.

This strategy requires only two values: a double for your current score, and an integer for your current exponent. When your cash gets too big, divide it by 10, and add one to the exponent. (When displaying these values, round to three decimal digits so that players won’t notice you’re using a floating-point value.)

Hey, do you like games? So do we — that’s what makes Kongregate the best source of free games online. We have thousands upon thousands of free online games, from both one-man indies and large studios, rated and filtered so you can play the best of the best. Read more »