00:00
00:00
Newgrounds Background Image Theme

kkolo just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Response to As: Api 2005-07-12 20:44:38


api is great, i love messing around with it i used it in my game Endless Flight the top an bottom are accually randomly generating api arrays that mask fireworks firle, it works alot like yor throw it game(which rocks!) i got a 368,175 in the older one and a 166345 in the ng version :(.
also lately ive been trying to make these.( ive made number 2, which is accually realy hard to get the circumcumcenter. and im trying to make 26, but am having trouble) he is possibly the greatest api programmer ever! 35 is definately the coolest

Response to As: Api 2005-07-12 20:46:53


oops forgot linkactionscript cl

Response to As: Api 2005-07-12 21:15:01


http://img323.images..?image=spiral6wh.swf

I made good use of the API in that example.

Response to As: Api 2005-07-12 21:28:55


At 7/12/05 07:56 PM, Denvish wrote: Initial version finished and submitted here... 1033 lines of code. I LIKE this API business =)

talking about that, if you wanna get some money for it, gimme a ring ;)

Response to As: Api 2005-07-12 21:33:58


MovieClip.prototype.val = function(n) {
return n>0 ? 1 : n<0 ? -1 : 0;
};
ar = new Array();
a = 50;
for (i=0; i<=550; i += 20) {
a += (random(3)-1)*20;
ar[i/20] = Math.abs(a);
}
l = ar.length;
_root.onEnterFrame = function() {
_root.createEmptyMovieClip("t", 2);
_root.createEmptyMovieClip("b", 1);
t.lineStyle(5, "0x000000");
b.lineStyle(5, "0x000000");
t.moveTo(0, 0);
b.moveTo(0, 400);
for (i=0; i<l; i++) {
t.lineTo(i*20, ar[i]+10);
b.lineTo(i*20, ar[i]+Math.max(150, 300)-5);
}
ar = ar.slice(1, l);
ar.push(Math.min(200, Math.abs(ar[l-2]+(val(random(3)-int(3/2))*
20))));
};
is the basic idea of how i did it,

Response to As: Api 2005-07-13 07:45:22


At 7/12/05 07:56 PM, Denvish wrote: Initial version finished and submitted here... 1033 lines of code. I LIKE this API business =)

Great! Just played it, the link on the right click menu aren't working for me though. The GoG one goes to the NG portal and the NG one goes somewhere random that takes ages to load. Don't know if this is just my PC or not :\

I can't understand those high scores either, they are Godlike!

Response to As: Api 2005-07-13 08:14:47


At 7/8/05 03:36 PM, -liam- wrote:
At 7/8/05 03:31 PM, -Toast- wrote: If you still don't believe me,msn me and I'll show it to you :P
You just want a mod on your MSN contacts :P I had Ozcar but he hardly goes on.. or he blocked me.

Heh,not at all! *Tries to make a serious face*.

I played the final version,I got much less than with the older version..

Older version record:
147845

New version record:
73634


BBS Signature

Response to As: Api 2005-07-13 09:14:39


denvish I found a glitch. After the ball lands you can keep throwing it to get an infinite score.

Response to As: Api 2005-07-13 09:25:31


At 7/13/05 09:14 AM, Glaiel_Gamer wrote: denvish I found a glitch. After the ball lands you can keep throwing it to get an infinite score.

Haha,*plays "throw" immediatly!*.


BBS Signature

Response to As: Api 2005-07-13 10:10:03


Denvish got sponsored for his API only game :) I think this is a true landmark :D

Response to As: Api 2005-07-13 10:11:41


At 7/13/05 10:10 AM, Inglor wrote: Denvish got sponsored for his API only game :) I think this is a true landmark :D

Yeah I was impressed.

How much for?

Response to As: Api 2005-07-13 10:16:55


At 7/13/05 10:11 AM, T-H wrote: Yeah I was impressed.

How much for?

I won't disclose that out of respect without denvish's permission, but more then 100 dollars.

Response to As: Api 2005-07-13 10:28:33


Hey inglor, if games of gondor is an NG buddy site why aren't you an affiliate?

Response to As: Api 2005-07-13 10:43:06


At 7/13/05 10:28 AM, Glaiel_Gamer wrote: Hey inglor, if games of gondor is an NG buddy site why aren't you an affiliate?

Glaiel Games are also an NG buddy, why aren't YOU affiliate?

Response to As: Api 2005-07-13 12:30:28


awesome game denvish, here's a preloader made with as and the drawing api.
it shows it as being on the bottom right when yu test your movies, but i've tested it online and it does align correctly.

halfx=Stage.width/2;
halfy=Stage.height/2;
createEmptyMovieClip("loadbar",3);
loadbar.lineStyle(1,0x000000);
loadbar.moveTo(-100,-10);
loadbar.lineTo(100,-10);
loadbar.lineTo(100,10);
loadbar.lineTo(-100,10);
loadbar.lineTo(-100,-10);
loadbar._x=halfx;
loadbar._y=halfy;
createEmptyMovieClip("fill",2);
fill.lineStyle(1,0x000000,0);
fill.beginFill(0xFF0000);
fill.moveTo(0,0);
fill.lineTo(200,0);
fill.lineTo(200,20);
fill.lineTo(0,20);
fill.lineTo(0,0);
fill._x=halfx-100;
fill._y=halfy-10;
fill.endFill;
fill.onEnterFrame=function() {
fill._xscale=(_root.getBytesLoaded()/_root
.getBytesTotal())*100;
if (_root.getBytesLoaded()==_root.getBytesTot
al()) {
//just change the following line to say _root.gotoAndPlay or gotoAndStop depending on
//what you want to happen :)
_root.gotoAndPlay(_root._currentframe+1);
fill.unloadMovie();
loadbar.unloadMovie();
textgo.unloadMovie();
}
}
createEmptyMovieClip("textgo",4);
textgo.mytext.type="static"
textgo.createTextField("mytext",5,0,0,70,2
0);
textgo.mytext.selectable=false
textgo.mytext.size = 18
textgo.mytext.textColor = 0x000000
textgo.mytext.underline = false
textgo.mytext.align = "left"
textgo.mytext.leftMargin = 0
textgo.mytext.rightMargin = 0
textgo.mytext.text="LOADING";
textgo._x=halfx-30
textgo._y=halfy-10
stop();

Response to As: Api 2005-07-13 13:25:28


At 7/13/05 10:16 AM, Inglor wrote: I won't disclose that out of respect without denvish's permission, but more then 100 dollars.

It was worth every penny, it's a great game :)

Heres a thing I made a while ago, I was just testing out the curveTo command.


_root.createEmptyMovieClip("box1", 11);
with (box1) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 10;
_y = 10;
}
_root.createEmptyMovieClip("box2", 12);
with (box2) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 110;
_y = 10;
}
_root.createEmptyMovieClip("box3", 13);
with (box3) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 60;
_y = 10;
}
_root.createEmptyMovieClip("box4", 14);
with (box4) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 10;
_y = 110;
}
_root.createEmptyMovieClip("box5", 15);
with (box5) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 10;
_y = 60;
}
_root.createEmptyMovieClip("box6", 16);
with (box6) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 110;
_y = 110;
}
_root.createEmptyMovieClip("box7", 17);
with (box7) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 110;
_y = 60;
}
_root.createEmptyMovieClip("box8", 18);
with (box8) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 60;
_y = 110;
}
_root.createEmptyMovieClip("box9", 19);
with (box9) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);
_x = 60;
_y = 60;
}
box1.onPress = function() {
startDrag(this);
};
box2.onPress = function() {
startDrag(this);
};
box3.onPress = function() {
startDrag(this);
};
box4.onPress = function() {
startDrag(this);
};
box5.onPress = function() {
startDrag(this);
};
box6.onPress = function() {
startDrag(this);
};
box7.onPress = function() {
startDrag(this);
};
box8.onPress = function() {
startDrag(this);
};
box9.onPress = function() {
startDrag(this);
};
onMouseUp = function () {
stopDrag();
};
onEnterFrame = function () {
_root.createEmptyMovieClip("line1", 1);
with (line1) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box3._x, box3._y, box2._x, box2._y);
}
_root.createEmptyMovieClip("line2", 2);
with (line2) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box5._x, box5._y, box4._x, box4._y);
}
_root.createEmptyMovieClip("line3", 3);
with (line3) {
lineStyle(2, 0xff0000, 100);
moveTo(box4._x, box4._y);
curveTo(box8._x, box8._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line4", 4);
with (line4) {
lineStyle(2, 0xff0000, 100);
moveTo(box2._x, box2._y);
curveTo(box7._x, box7._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line5", 5);
with (line5) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box9._x, box9._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line6", 6);
with (line6) {
lineStyle(2, 0xff0000, 100);
moveTo(box2._x, box2._y);
curveTo(box9._x, box9._y, box4._x, box4._y);
}
};

It's long because it's beautiful.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-07-13 14:04:00


At 7/13/05 10:11 AM, T-H wrote:
At 7/13/05 10:10 AM, Inglor wrote: Denvish got sponsored for his API only game :) I think this is a true landmark :D
Yeah I was impressed.

How much for?

T-H I will give you $100,000 for your sig with the naked chick


- Matt, Rustyarcade.com

Response to As: Api 2005-07-13 14:06:54


thats pretty cool. i hate curveto because it's so hard to use dynamically

Response to As: Api 2005-07-13 14:26:51


At 7/13/05 02:04 PM, Ninja-Chicken wrote:
At 7/13/05 10:11 AM, T-H wrote:
At 7/13/05 10:10 AM, Inglor wrote: Denvish got sponsored for his API only game :) I think this is a true landmark :D
T-H I will give you $100,000 for your sig with the naked chick

I will give you secks for yours.

Response to As: Api 2005-07-13 14:39:23


At 7/13/05 02:26 PM, T-H wrote:
At 7/13/05 02:04 PM, Ninja-Chicken wrote:
At 7/13/05 10:11 AM, T-H wrote:
At 7/13/05 10:10 AM, Inglor wrote: Denvish got sponsored for his API only game :) I think this is a true landmark :D
T-H I will give you $100,000 for your sig with the naked chick
I will give you secks for yours.

hmmm done


- Matt, Rustyarcade.com

Response to As: Api 2005-07-13 14:55:56


At 7/13/05 02:06 PM, punkkid7188 wrote: i hate curveto because it's so hard to use dynamically

In what way?

You mean getting the right angle? If so then just use a post-it to draw what you want, then figure out the co-ords through that, testing the movie at every line.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-07-13 15:04:33


At 7/13/05 02:55 PM, -liam- wrote:
just use a post-it to draw what you want, then figure out the co-ords through that, testing the movie at every line.

Yellow stickies rule don't they? I used to use them all the time to sketch out AS stuff.

Then I ran out.

Response to As: Api 2005-07-13 15:13:23


_root.createEmptyMovieClip("clip", 100);
cubeNmbr = 25;
point1 = [275, 100];
point2 = [275, 100];
mid = 200;
xspeed = 0;
yspeed = 0;
dragging = false;
function cubeF(tgt) {
tgt.xspeed += Math.random()-.5;
tgt.yspeed += Math.random()-.5;
tgt._x += tgt.xspeed;
tgt._y += tgt.yspeed;
while (!clip.hitTest(tgt._x+10, tgt._y, true)) {
tgt._y += 1;
}
if (tgt._x<0) {
tgt._x = 0;
tgt.xspeed = 0;
}
if (tgt._y>380) {
tgt._y = 380;
tgt.yspeed = 0;
}
if (tgt._x>530) {
tgt._x = 530;
tgt.xspeed = 0;
}
}
for (var i = 0; i<cubeNmbr; i++) {
_root.createEmptyMovieClip("cube"+i, i+1);
makeCube(_root["cube"+i]);
_root["cube"+i]._x = random(550);
_root["cube"+i]._y = random(200)+200;
}
function make() {
clip.clear();
clip.lineStyle(6, 0x00ff00, 90);
clip.beginFill(0x00ff00, 30);
clip.moveTo(0, mid);
clip.curveTo(point1[0], 400-(point1[1]*2), 550, mid);
clip.lineTo(550, 400);
clip.lineTo(0, 400);
clip.lineTo(0, mid);
clip.endFill();
xspeed -= (point1[0]-point2[0])/10;
yspeed -= (point1[1]-point2[1])/6;
point1[0] += xspeed;
point1[1] += yspeed;
xspeed *= .9;
yspeed *= .9;
if (dragging == true) {
xspeed = 0;
yspeed = 0;
point1[0] = _root._xmouse;
point1[1] = 300-(_root._ymouse);
}
}
make();
_root.onEnterFrame = function() {
make();
};
function makeCube(tgt) {
tgt.lineStyle(1, 0x0000ff, 100);
tgt.beginFill(0x00ffff, 100);
tgt.moveTo(0, 0);
tgt.lineTo(20, 0);
tgt.lineTo(20, 20);
tgt.lineTo(0, 20);
tgt.lineTo(0, 0);
tgt.endFill();
tgt.xspeed = 0;
tgt.yspeed = 0;
tgt.onEnterFrame = function() {
cubeF(tgt);
};
}
_root.onMouseDown = function() {
dragging = true;
};
_root.onMouseUp = function() {
dragging = false;
};

Response to As: Api 2005-07-13 15:25:29


nice api.
but when i mean i cant use dynamically, i mean like it was used it that actionscript cl thing(number 25) ive been trying to do notice theres really only like 5 points where it curves, but the line is so incredibly smooth that it looks like hundred. when i tried that, it bended the wrong way half the time

Response to As: Api 2005-07-13 15:26:45


At 7/13/05 03:13 PM, Glaiel_Gamer wrote:

Have you got an infinite loop in there? Because it didnt execute properly for me, got the same old "Do you want to abort this script" message as it froze up.

Response to As: Api 2005-07-13 15:37:30


try changing the load order

Response to As: Api 2005-07-13 16:37:23


I'm not going to release the whole code for Throw It, but here's how the code for the background & hills. It basically involved a lot of testing with curveTo parameters and
randomly generated numbers.

//Best at 50 FPS
Stage.scaleMode="showAll";
SW=Stage.width;
SH=Stage.height;
HC=4000;

C1=new Array ("0x000066", "0x632794", "0xB10303", "0x000033", "0x6D6DFE", "0xCC33FF", "0x4B016B", "0xFF9900", "0xFEBE81")
C2=new Array ("0x00CCFF", "0x00FFFF", "0xFFFF99", "0x003399", "0xE6FFFF", "0x01ADAD", "0xFF99FF", "0xFFFFCC", "0xFFFFC1")

function makeback(){
cs=random(C1.length)
with(_root){ //Back colour
beginFill(C1[cs], 100);
moveTo(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
lineTo(0, 0);
endFill();
}
_root.createEmptyMovieClip("fbk", 1000);
with(fbk){ //Back gradient
incr=SH/100;
fbkY=0;
for(i=0;i<101;i++){
beginFill(C2[cs], i);
moveTo(0, fbkY);
lineTo(SW, fbkY);
lineTo(SW, fbkY+incr);
lineTo(0, fbkY+incr);
lineTo(0, fbkY);
endFill();
fbkY+=incr;
}
}
}

//=====Create hills===================

function makehills(SP){ //M=Hillbase - N=Hillpeak
if(HC==4000){ //P=Hillbase incr - TW=Width - SP=Starting _x co-ord
HC++;
}else{
HC--;
}
_root.createEmptyMovieClip ("bkm"+HC, HC);
with(_root["bkm"+HC]) {
M=10;
N=random(20)+5;
P=random(25)+10;
TW=700+random(800);
X=0;
oldX=0;
oldY=0;
beginFill(0x000000,30);
moveTo(0,SH);
while(X<TW){
X+=random(80)+40;
D=(X-oldX)/2;
E=((X-D)-(D/3))+random(D/1.5);
Y=SH-(random(M)+M/2);
if(X<TW){
curveTo(E, Y-random(N), X, Y)
}else{
curveTo(E, Y-random(N), X, SH);
}
oldX=X;
oldY=Y;
if(X<TW/2) {
M+=P;
}else{
M-=P;
}
}
endFill();

_x=SP;
bkm=_root["bkm"+HC];
if(HC==4000){
bkp=bkm4001;
}else{
bkp=bkm4000;
}
}
}

_root.onEnterFrame=function(){ //Scroll hills
bkm._x-=6;
bkp._x-=6;
if(bkm._x<-(bkm._width-SW)){
makehills(SW);
}
if(bkm._x<-(bkm._width)){
removeMovieClip(bkm);
}
}

makeback()
makehills(0)

Result


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-07-13 16:43:01


It must be kind of annoying that (regardless of how cool THROW IT! is) a couple of weeks work ends up with a higher newgrounds score than the masterpiece of Overrun II.

Seriously though I'm loving all these AS games being created, maybe I should stop being lazy and get creative.

Response to As: Api 2005-07-13 16:52:08


At 7/13/05 01:25 PM, -liam- wrote: It's long because it's beautiful.

It's pretty cool to give an idea of how curveTo works. One for loop and a couple of arrays make it a lot shorter codewise, though - try this =)

PosX=new Array(10, 110, 60, 10, 10, 110, 110, 60, 60)
PosY=new Array(10, 10, 10, 110, 60, 110, 60, 110, 60)

for(i=1;i<10;i++){
_root.createEmptyMovieClip("box"+i, i+30);
with (_root["box"+i]) {
lineStyle(1, 0x000000, 100);
moveTo(-2.5, -2.5);
beginFill(0xffffff, 50);
lineTo(2.5, -2.5);
lineTo(2.5, 2.5);
lineTo(-2.5, 2.5);
lineTo(-2.5, -2.5);

_x = PosX[i-1];
_y = PosY[i-1];

_root["box"+i].onPress = function() {
startDrag(this);
}
}
}
onMouseUp = function () {
stopDrag();
};
onEnterFrame = function () {
_root.createEmptyMovieClip("line1", 1);
with (line1) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box3._x, box3._y, box2._x, box2._y);
}
_root.createEmptyMovieClip("line2", 2);
with (line2) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box5._x, box5._y, box4._x, box4._y);
}
_root.createEmptyMovieClip("line3", 3);
with (line3) {
lineStyle(2, 0xff0000, 100);
moveTo(box4._x, box4._y);
curveTo(box8._x, box8._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line4", 4);
with (line4) {
lineStyle(2, 0xff0000, 100);
moveTo(box2._x, box2._y);
curveTo(box7._x, box7._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line5", 5);
with (line5) {
lineStyle(2, 0xff0000, 100);
moveTo(box1._x, box1._y);
curveTo(box9._x, box9._y, box6._x, box6._y);
}
_root.createEmptyMovieClip("line6", 6);
with (line6) {
lineStyle(2, 0xff0000, 100);
moveTo(box2._x, box2._y);
curveTo(box9._x, box9._y, box4._x, box4._y);
}
};


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-07-13 19:53:37


Denvish how did you get so good at AS?