The AS Battle Game

what exactly is to be done?
shall we redo the rotation (using the mouse) of the dns ?
add the random colors to background and dns?
redo the complete footer???
or just something specific like the 3d rotation?
(I guess here is somebody who want’s us to rewrite his footer in pure as? :h: :smiley: :smiley:

redo the rotation (using the mouse) of the dns
add the random colors to background and dns?
and the number thing

What kind of battle is this???

Anyway, Voetsjoeba, I really like what you did :love:

Yeah, I’m getting confused too.

Thanks pom, I really like what you did too :love:

No I liked what you did MORE!! :scream:

No, we love both’s equally :slight_smile:

haha, I like mine most :wink:

[size=1]just a joke[/size]

The reason why McGiver won is because his effect is the exact effect I was looking for. This isn’t really a battle its a game

:jag: :cyclops: :gas:

i win i win :smiley:


MovieClip.prototype.drawCircle = function(x, y, theColor) {
	this.moveTo(Math.cos(0)*5+x, Math.sin(0)*5+y);
	this.lineStyle(0, 0x000000, 0);
	this.beginFill(theColor, 100);
	for (var radians = 0; radians<Math.PI*2; radians += Math.PI/180) {
		this.lineTo(Math.cos(radians)*5+x, Math.sin(radians)*5+y);
	}
	this.endFill();
};
MovieClip.prototype.makeThing = function(num) {
	this.theColor = Math.round(Math.random()*255);
	this.drawCircle(-25, 0, this.theColor);
	this.lineStyle(3, this.theColor, 100);
	this.moveTo(-25, 0);
	this.lineTo(25, 0);
	this.drawCircle(25, 0, this.theColor);
	this._x = 10*num;
	this._y = 100;
	this._rotation = 20*num;
	this._xscale = this._yscale=10*num;
	this._alpha = 10+(90/_root.count)*num;
	this.onEnterFrame = function() {
		this._rotation += (_root._xmouse-300)/50;
	};
};
_root.createTextField("input_txt", 0, 290, 80, 20, 20);
input_txt.type = "input";
input_txt.border = true;
input_txt.maxChars = 2;
input_txt.restrict = "0-9";
_root.createEmptyMovieClip("button_mc", 1);
button_mc._x = 290;
button_mc._y = 100;
button_mc.createTextField("text_txt", 0, -45, 0, 100, 20);
button_mc.text_txt.text = "Go: A numder 5-50";
button_mc.text_txt.selectable = false;
button_mc.onPress = function() {
	if (Number(input_txt.text)>=5 && Number(input_txt.text)<=50) {
		_root.count = Number(input_txt.text);
		for (var j = 0; j<_root.count; j++) {
			_root.createEmptyMovieClip("thing"+j, j);
			_root["thing"+j].makeThing(j);
		}
	}
};

:smiley:

nice one @ master64.
I think you will have to add some random cycling colors

Wowow, what is this thread about ? Is this a battle or a game ? Is this about DNA or bouncing ?? :h:

its about bouncing DNA :stuck_out_tongue:
:h:

[size=1]well i dunno thay say make DNA so i make DNA :smiley: [/size]

@McGiver I will be add the color thing soon

Lol :stuck_out_tongue:

its got a bit messy :stuck_out_tongue:


MovieClip.prototype.drawCircle = function(x, y) {
	this.moveTo(Math.cos(0)*5+x, Math.sin(0)*5+y);
	this.lineStyle(0, 0x000000, 0);
	this.beginFill(0x000000, 100);
	for (var radians = 0; radians<Math.PI*2; radians += Math.PI/180) {
		this.lineTo(Math.cos(radians)*5+x, Math.sin(radians)*5+y);
	}
	this.endFill();
};
MovieClip.prototype.makeThing = function(num) {
	this.drawCircle(-25, 0);
	this.lineStyle(3, 0x000000, 100);
	this.moveTo(-25, 0);
	this.lineTo(25, 0);
	this.drawCircle(25, 0);
	this._x = 10*num;
	this._y = 100;
	this._rotation = 20*num;
	this._xscale = this._yscale=10*num;
	this._alpha = 10+(90/_root.count)*num;
	this.num = num;
	this.onEnterFrame = function() {
		this._rotation += (_root._xmouse-300)/50;
		var red = 127*(1+Math.sin(this.num/10+(this.red += incr_red)));
		var green = 127*(1+Math.sin(this.num/10+(this.green += incr_green)));
		var blue = 127*(1+Math.sin(this.num/10+(this.blue += incr_blue)));
		var colRand = red << 16 | green << 8 | blue;
		var c = new Color(this);
		c.setRGB(colRand);
	};
};
incr_red = Math.random()/10;
incr_green = Math.random()/10;
incr_blue = Math.random()/10;
_root.createTextField("input_txt", 0, 290, 80, 20, 20);
input_txt.type = "input";
input_txt.border = true;
input_txt.maxChars = 2;
input_txt.restrict = "0-9";
_root.createEmptyMovieClip("button_mc", 1);
button_mc._x = 290;
button_mc._y = 100;
button_mc.createTextField("text_txt", 0, -45, 0, 100, 20);
button_mc.text_txt.text = "Go: A numder 5-50";
button_mc.text_txt.selectable = false;
button_mc.onPress = function() {
	if (Number(input_txt.text)>=5 && Number(input_txt.text)<=50) {
		_root.count = Number(input_txt.text);
		for (var j = 1; j<_root.count+1; j++) {
			_root.createEmptyMovieClip("thing"+j, j);
			_root["thing"+j].makeThing(j);
		}
		_root.createEmptyMovieClip("background_mc", 0);
		var red = Math.round(Math.random()*255);
		var green = Math.round(Math.random()*255);
		var blue = Math.round(Math.random()*255);
		var colRand = red << 16 | green << 8 | blue;
		background_mc.beginFill(colRand, 100);
		background_mc.lineTo(Stage.width, 0);
		background_mc.lineTo(Stage.width, Stage.height);
		background_mc.lineTo(0, Stage.height);
		background_mc.endFill();
	}
};

:smiley:

Ok seeing no one is saying I win :frowning:
I will say I win :bad: and call the next challenge

Challenge 3

… some thing I can make too!?! :sleep: …
A man that you can move around with your keybord/mouse. Then there is also a thing moving around randomly and avoiding the man a bit. Where the man hits the thing you win…a kind of hunt thing.

So will that do? :}

Created this quickly, for myself actually, to see if I could do something like that. The arrow isn’t too smart though :stuck_out_tongue:


d = 0;
dotsize = 10;
boundary = {x:350, y:250, w:350, h:350};
Math.toDegrees = function(radians) {
	return radians*180/Math.PI;
};
MovieClip.prototype.drawBoundary = function() {
	var k = boundary;
	var b = dotsize/2;
	with (this) {
		lineStyle(1, 0x000000, 100);
		moveTo(-k.w/2-b, -k.h/2-b);
		lineTo(k.w/2+b, -k.h/2-b);
		lineTo(k.w/2+b, k.h/2+b);
		lineTo(-k.w/2-b, k.h/2+b);
		lineTo(-k.w/2-b, -k.h/2-b);
		_x=k.x, _y=k.y;
	}
};
MovieClip.prototype.makeLine = function(l, x, y) {
	with (this) {
		lineStyle(1, 0x000000, 100);
		lineTo(l, 0);
		lineTo(l/2+l/4, l/4);
		moveTo(l, 0);
		lineTo(l/2+l/4, -l/4);
		_x=x, _y=y;
	}
};
MovieClip.prototype.makeGuy = function(x, y) {
	Key.addListener(this);
	with (this) {
		lineStyle(dotsize, 0x000000, 50);
		lineTo(.15, .45);
		lineStyle(1, 0x000000, 100);
		_x=x, _y=y;
	}
};
this.createTextField("win", d++, boundary.x-20, boundary.y, 70, 20);
this.createEmptyMovieClip("run", d++).makeLine(10, 350, 250);
this.createEmptyMovieClip("guy", d++).makeGuy(400, 260);
this.createEmptyMovieClip("boundaryLines", d++).drawBoundary();
guy.onEnterFrame = function() {
	//guy.onKeyDown = function() {
	if (Key.isDown(Key.UP) && this._y-dotsize/2>boundary.y-boundary.h/2) {
		this._y -= dotsize;
	}
	if (Key.isDown(Key.DOWN) && this._y+dotsize/2<boundary.y+boundary.h/2) {
		this._y += dotsize;
	}
	if (Key.isDown(Key.LEFT) && this._x-dotsize/2>boundary.x-boundary.w/2) {
		this._x -= dotsize;
	}
	if (Key.isDown(Key.RIGHT) && this._x+dotsize/2<boundary.x+boundary.w/2) {
		this._x += dotsize;
	}
};
run.onEnterFrame = function() {
	if (guy._x<boundary.x) {
		if (this._x+this._width+dotsize/2<boundary.x+boundary.w/2) {
			this._x += dotsize*1.5;
		}
	} else {
		if (this._x-dotsize/2>boundary.x-boundary.w/2) {
			this._x -= dotsize*1.5;
		}
	}
	if (guy._y<boundary.y) {
		if (this._y+this._height+dotsize/2<boundary.y+boundary.h/2) {
			this._y += dotsize*1.5;
		}
	} else {
		if (this._y-dotsize/2>boundary.y-boundary.h/2) {
			this._y -= dotsize*1.5;
		}
	}
	if (this.hitTest(guy)) {
		delete this.onEnterFrame;
		win.text = "You win !";
	}
};

:!: your fast :cool:

ok you win your turn :wink:

I want you guys to make some too so I can learn :slight_smile:

ok but not now am going to bed :stuck_out_tongue:

I need my sleep :sleep: