Protect your work from ActionScript code theft with SWF Protector

« I’ve just found a site that won a top international online advertising award – and it’s been blatantly lifted from me!

Its a flash application that has the same vectors and almost certainly the same AS code. Is there anything I can do? I’m in the UK – they’re in Brazil. »

The guy who opened this thread looks quite desperate… now imagine this happening to your latest Flash game.

That’s why you must protect your code. You don’t want someone else stealing your work.

I am going to review DCOM Soft‘s SWF Protector.

SWF Protector

SWF Protector is an swf protector software working through actionscript encryption to secure your actionscript content. This means decompilers won’t be able to read your actionscript. Read more

Goodbye AS2…

If you noticed, my last post about AS2 coding is New tile based platform engine – part 11 – slopes part b, almost a month ago.

I decided to quit talking about AS2 because I am not using it anymore, excluding a couple of games I am about to complete.

I am not that happy I had to learn a language I won’t use anymore, but this happened a lot of times in my life… from Commodore Basic to AS2, including AMOS, Pascal and some more.

When a programmer quits a language, it’s not a big problem, but when a blogger does it, he should think about his readers that don’t want to migrate to a new language.

While I don’t want to force anybody, let me share some thoughts:

You can get the latest Flash version, the so called CS4, for $699, and you can download a complete trial working for 30 days.

Even if you don’t have the money, I suggest you to download the trial, make a couple of simple games in a month and raise the funds to buy the license.

All new cool libraries are written in AS3, just think about BOX2D and the games you can make with it.

A PROgrammer **must** know the latest languages, not the old ones. Soon you won’t find any AS2 tutorial around the web.

Last but not least, you can make your own custom tombstone at tombstonebuilder.com.

What about old AS2 tutorials? Well, the most successful ones will be translated into AS3 using classes. Which one would you like to see first?

Platform engine variation with hangable tiles

This is another version of my platform engine made by Bryan Devlin introducing some graphics, a visual death and hangable roofs.

Bryan spread out the code to follow and understand it a bit better.

This is what you’ll get:

Notice the hangable tiles, that’s the major improvement.

You can download source code here.

Also, Bryan is working on a game probably started from my engine but with some new features like climbable walls, scrolling maps and timer, and would like some feedback… here it is the game:

Thanks Bryan!

How to ask for help: the Philippines example

Normally everyday I receive about 10 emails asking for help.

They all seem to be made with a template, something like this: “hey this script does not work. Can you fix it?”

Obviously I cannot fix someone else’s scripts, but sometimes I got really impressed by an help request.

It happened about one year ago and it’s happening today.

This is an email from Jv Caalim from Philippines, in trouble with his computer science thesis…

« Hello Sir, and Good day.

Im Jv Caalim from the Philippines and im a computer science student from AMA computer college (a really crappy school if you ask me..), recently ive been basing my entire Thesis heavily on your tile-based tutorials (which is really really great btw im a fanboy of your site now lol).

My thesis entitled “Asian Museum” is an eduactional game aim for highschool students about, some limited scopes on a few Asian countries, it will be like a clone of castlevania (the player defeats an enemy using a linear weapon not by jumping on them) and along the way the player will recieve hints on how to open the door leading to the next level like ex:”Player battles a monster and gets
Chrysanthemun which is also a name for the national flower of Japan”, the door will be asking questions about asian countries like, “what is the national flower of Japan?”. the boss battle is a turn base system (which is only shown graphically) where random questions about asian history appears on the screen if the player answer it correctly the boss monster gets damaged

As of now i can only say that im still learning on what engine to use, ive also been reading about tonypa’s tile-based tutorials and it was quite helpfull but still there is one thing thats always leaving me confuse, the Collision engine that was used on tile based platforms engine, and if ever i tried experimenting with the collision engines it always ends messing up the collisions… sure the collision works if the “player” is smaller than the tiles but,

What if the player is bigger than the tiles?? lets say i have a 50×50 tile and the player is 49 pixels in width and 98 pixels in height (so that right = 24, left = -24, top = -49, bottom = 49) so its like the player is 2 tiles high and 1 tile wide, or what if the tile size is 25×25 meaning the player is 4 tiles high and 2 tiles wide? how can i make a collision engine for that?

i already know how all the basic movements of the character works and already applied that to a non tile based platform engine that i made (which has a lot of frustrating collision bugs). im not at all a beginner on programming nor a pro but, i have background on programing on VB and C++ on simple programs, and the basics on programming on AS2 (but im still confuse on AS3).

so i would like to ask for some help or at least a detailed explenantion on how i can fix my collision problems. i know that you are a very busy person and im sorry if i have to ask too much of a favor, im still a student i dont have a job yet so im sorry if i cant pay you anything but, i could at least give you all the rights on the game(thesis), most specially the “player sprite” i made by hand (its still not finish but i will give you all of it if its finished), you can also ask me to make you some sprites on your game for free if you like, so pls im begging for help… the submission for the thesis will be on Dec 6, and i havent really made anything that could be usefull to the game except the sprites.

P.S sorry if my sentences sounds as if i was demanding (or commanding you), my english is a bit bad.

Hoping for your relpy and more power to your site
(some of my recent experiments on .fla is attach on this email pls do scan it first for precausions) »

You will find the files here.

I hope Jv (I am really curious to know does it sound this name) can get some help, maybe someone can save his thesis.

ActionScript 2.0 to 3.0 Migration Cheatsheet

If you are worried about the changes introduced by AS3 and would like a cheatsheet for a quick reference of most of them, then you should take a look at http://actionscriptcheatsheet.com/

This site provides some interesting printable quick reference cards for the ActionScript language. AS3, Flex, AIR, Papervision, and more.

Unfortunately the site seems to be inactive for almost a year, so I suggest you to download them quickly.

This is the ActionScript 2.0 to 3.0 migration cheatsheet

In the downloads page you will find more.

Hope this will help you in the migration.

New tile based platform engine – part 11 – slopes part b

As said in New tile based platform engine – part 11 – slopes part a, the game needed a fix for the jump from/on slope bug.

In part b the bug becomes a glitch… now you can jump from/on the slope but sometimes there is a “rebounce” glitch.

It’s very easy to determine why it’s happening and fix it… I am just leaving the explication for next time because I just got my computer repaired and need to do a lot of things.

I just wanted to answer a question about senseless slopes and N game mechanics.

There is a lot of difference between my tile based engine and a raycasting one.

Maybe I’ll cover it in next future.

Meanwhile, you are invited to take a look at the source code and fix the glitch at line 338 Read more

New tile based platform engine – part 11 – slopes part a

You asked for it, I made it… ladies and gentlemen… SLOPES! (applause).

I decided to split slopes in two parts, because they are a bit more difficult than other tile types.

In this part, you can walk on slopes but you can’t jump on/from them. Oh, well, you can actually jump or land on them, but without the second part of the code, there could be some glitches.

Obviously if you want to suggest your jumping routine, you’re welcome.

Slopes need a lot of rules in order to work, that can be summarized in one big rule: don’t make senseless slopes.

For senseless slopes I mean everything… senseless… refer to the picture:

Green shapes show some possible slopes while red ones show impossible ones.

Then the is_on_slope function solves slope walking.

Once I’ll publish jumping routine, I’ll write a detailed slope tutorial.

Meanwhile take the source code: Read more

New tile based platform engine – part 10 – optimization, doors n’ keys

Here we are with some optimization, as well as a feature some people requested: doors and keys.

Let’s start with the first optimization step.

Optimization

See how does the script at step 9 determine if a tile is walkable (player can pass through it):

if ((top_right != 0 and top_right != 5 and top_right != 6 and top_right != 7) or (bottom_right != 0 and bottom_right != 5 and bottom_right != 6 and bottom_right != 7)) {

I have to check if all values are different from 0, 5, 6 and 7 because 0 = empty, 5 = cloud, 6 = ladder and 7 = trampoline.

Nothing difficult at this point, but let’s imagine I am going to add another walkable tile… I should update the and formula by adding the new tile type.

The more walkable tiles I add, the more the probability of making errors or forgetting something.

So I created an array with all walkable tiles this way:

walkable_tiles = Array(0, 5, 6, 7);

Then the old code becomes

if (!is_walkable(top_right) or !is_walkable(bottom_right)) {

Where is_walkable is basically an in_array function (not included in AS2!!)

1
2
3
4
5
6
7
8
9
10
function is_walkable(tile) {
	walkable = false;
	for (x=0; x<walkable_tiles .length; x++) {
		if (tile == walkable_tiles[x]) {
			walkable = true;
			break;
		}
	}
	return (walkable);
}

Doors and keys

A door is a unwalkable tile that becomes a walkable one when the player takes its key.

Every key is an array made this way:

[key x pos, key y pos, door x pos, door y pos]

Meaning that the key is located at (key x pos, key y pos) and once collected opens the door at (door x pos, door y pos).

Let’s see the source: Read more

Create a Flash game like Gold Miner – step 2

I received a lot of emails asking me to add left-right movement to my Gold Miner clone and requiring more information about manually placing the boulders.

In order to add left-right movement, you need to check for left and right arrow keys and move the hook in the proper direction.

Just remember you don’t have to let the hook move out of the stage and to update the starting/ending points of the rope.

When you want to manually place boulders, you need an array.

In the one I created, every boulder is an array made this way

[x position, y position, diameter]

Then I created an array containing n boulder arrays where n is the number of boulder I wanted to be in the stage.

Here it is the commented code: Read more

New tile based platform engine – part 9 – coins n’ spikes

You asked for coins and spikes, and here they are…

As usual I had to define some rules… in this case spikes are deadly only when the player has both feet on it… later I will make a lava (or electric) tile that will kill the player even if he only has one foot on it.

At the moment the player just restarts when he dies, later I will manage real deaths.

Coins are… well… coins… just collect them.

Fix for the fix for infamous Ladder Bug in the Platform Tutorials

In New tile based platform engine – more theory I said superdean fixed the ladder bug… that’s not completely true because with his code the player cannot climb down a ladder when he’s walking over it.

So the correct if statement to perform when the player presses DOWN is neither mine

if (over == "ladder") {

nor superdean’s one

if (top_right == 6 or bottom_right == 6 or top_left == 6 or bottom_left == 6){

but

if ((over == "ladder") or (top_right == 6 or bottom_right == 6 or top_left == 6 or bottom_left == 6)) {

Now grab the source code: Read more

Next Page →