home page icon Flash Bestiary / BASICs / Spikies
   

Spikies

This is also a modification of the second program in this series (Random Pixels x 4).

In this version, instead of drawing a simple block, we draw a spiky shape, using the curveto() function, which draws quadratic bezier curves.

Here's the code for drawing the spikey shape:

this.moveTo(0,0);
this.beginFill(this.tint);
var cx = TILE_X/2;
var cy = TILE_Y/2;
this.curveTo(cx,cy,0+TILE_X,0);
this.curveTo(cx,cy,0+TILE_X,0+TILE_Y);
this.curveTo(cx,cy,0,0+TILE_Y);
this.curveTo(cx,cy,0,0);
this.endFill();

 

sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Mystify

Having trouble opening the project? You may need to Upgrade to Flash MX 2004



Copyright © 2003,2004 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback