Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------
- // Frame 1
- //--------------------------------------------------------------------
- stop();
- Mouse.hide();
- glo_color=0xff0000;
- _root.createEmptyMovieClip("drawfld",1);
- drawfld._x=20;
- drawfld._y=20;
- //---------------------
- mango.x_speed=3;
- mango._xscale*=-1;
- mango.y_speed=3;
- n_mangos=0;
- //mango.onLoad=mangoload;
- mango.onEnterFrame=mangoEntFrame;
- //---------------------
- ball_a.psy=0;
- ball_a.rad=70;
- ball_a.get_x= function () {
- return 200+this.rad*Math.cos(this.psy);
- }
- ball_a.get_y= function () {
- return 200+this.rad*Math.sin(this.psy);
- }
- ball_a.onEnterFrame=ballEntFrame;
- //---------------------
- /*var ball_arr:Array =[];
- for (var i=0; i<5; i++) {
- ball_arr[i]=attachMovie("ball"+i,"ball"+i,i);
- ball_arr[i]._x=10;
- ball_arr[i]._y=10;
- ball_arr[i].psy=random(5);
- ball_arr[i].rad=random(100);
- ball_arr[i].onEnterFrame=ballEntFrame;
- }*/
- //-----------------------------------
- r_mcc.onRelease = function() {glo_color=0xff0000};
- g_mcc.onRelease =function() {glo_color=0x00ff00};
- z_box.onEnterFrame = z_box_test;
- function z_box_test() {
- if (this.hitTest(human3)) {
- this.onEnterFrame=null;
- //stopDrag();
- this.gotoAndPlay(2);
- }
- }
- //-----------------------------------
- for (i=0; i<5; i++) {
- duplicateMovieClip(z_box,"z_box"+i,i);
- f=eval("z_box"+i)
- f._x=random(Stage.width);
- f._y=random(Stage.height);
- f.onEnterFrame=z_box.onEnterFrame;
- }
- //-----------------------------------
- ris = function() {
- lineTo(z_poin3._x,z_poin3._y);
- }
- z_poin3.onEnterFrame = function () {
- this._x=_root._xmouse;
- this._y=_root._ymouse;
- }
- z_poin3.onMouseDown = function () {
- lineStyle(1, glo_color, 60);
- moveTo(this._x, this._y);
- uu=setInterval(ris,10);
- }
- z_poin3.onMouseUp = function() {
- clearInterval(uu);
- }
- //-----------------------------------
- human3.onPress = function() {
- startDrag(this);
- }
- human3.onRelease = function() {
- stopDrag();
- }
- human3.onReleaseOutside = function () {
- stopDrag();
- }
- //-----------------------------------
- mango.onRollOver= function () {
- this.s0=200;
- }
- //-----------------------------------
- mango.onRollOut = function () {
- this.s0=100;
- }
- //-----------------------------------
- function mangoload() {
- this.x_speed=3;
- this.y_speed=3;
- }
- //-----------------------------------
- function ballEntFrame() {
- this.psy+=.1;
- this.rad+=-1+random(3);
- this._x=this.get_x();
- this._y=this.get_y();
- //_root.lineStyle(random(5),0x880000);
- drawfld.lineStyle(random(8),random(256)*256*256);
- drawfld.beginFill(0x7878ff);
- drawfld.moveTo(
- this._x-1-drawfld._x,this._y-1-drawfld._y);
- drawfld.lineTo(
- this._x-drawfld._x,this._y-drawfld._y);
- drawfld.endFill();
- }
- //-----------------------------------
- function mangoEntFrame() {
- //-------------------------
- if (Key.isDown(Key.LEFT)) {
- this.x_speed--;
- }
- if (Key.isDown(Key.RIGHT)) {
- this.x_speed++;
- }
- if (Key.isDown(Key.UP)) {
- this.y_speed--;
- }
- if (Key.isDown(Key.DOWN)) {
- this.y_speed++;
- }
- code=Key.getAscii();
- code3=Key.getCode();
- code4=chr(code);
- if (code4=='q') {
- this.x_speed/=1.1;
- this.y_speed/=1.1;
- }
- //-------------------------
- this._x+=this.x_speed;
- this._y+=this.y_speed;
- //-------------------------
- sclx=this._width/2*
- Math.abs(this._xscale/100);
- scly=this._height/2*
- Math.abs(this._yscale/100);
- if ((this._x>(Stage.width-sclx)) || (this._x<sclx)){
- this.x_speed*=-1;
- this._xscale*=-1;
- this._x+=this.x_speed;
- }
- //-------------------------
- if ((this._y>(Stage.height-scly)) || (this._y<scly)) {
- this.y_speed*=-1;
- this._y+=this.y_speed;
- }
- vx=this.s0-this._yscale;
- this._yscale+=vx/20;
- this._xscale+= this._xscale<0 ? -vx/20 : vx/20;
- //this._rotation=
- // Math.atan2(this.y_speed,this.x_speed)*180/3.14;
- }
- //--------------------------------------------------------------------
- // human symbol
- //--------------------------------------------------------------------
- //----------------------------------------
- onClipEvent(load) {
- this.angl=0;
- this.sp=0;
- }
- //----------------------------------------
- onClipEvent(enterFrame) {
- this._x+=this.sp*Math.cos(this.angl);
- this._y+=this.sp*Math.sin(this.angl);
- this._rotation=this.angl/3.14*180;
- if (this._x<0) this._x=Stage.width;
- if (this._x>Stage.width) this._x=0;
- if (this._y<0) this._y=Stage.height;
- if (this._y>Stage.height) this._y=0;
- //_root.inf_t.text=this.sp;
- //_root.z_tt=this.sp;
- }
- //----------------------------------------
- on (keyPress "<Right>") {
- this.angl+=.05;
- }
- //----------------------------------------
- on (keyPress "<Left>") {
- this.angl-=.05;
- }
- //----------------------------------------
- on (keyPress "<Up>") {
- this.sp+=1;
- }
- //----------------------------------------
- on (keyPress "<Down>") {
- this.sp-=1;
- if (this.sp<0) this.sp=0;
- }
- //----------------------------------------
- //--------------------------------------------------------------------
- // button stop
- //--------------------------------------------------------------------
- on (release) {
- if (n_mangos>0) {
- removeMovieClip("mango"+n_mangos);
- n_mangos--;
- } else {
- gotoAndStop(2);
- Mouse.show();
- }
- }
- //--------------------------------------------------------------------
- // button go
- //--------------------------------------------------------------------
- on (release) {
- n_mangos++;
- duplicateMovieClip(_root.mango,
- "mango"+n_mangos,n_mangos);
- z_mag=eval("mango"+n_mangos);
- z_mag.x_speed=4;
- z_mag.y_speed=4;
- z_mag.onEnterFrame=mangoEntFrame;
- z_mag.onRollOver=mango.onRollOver;
- z_mag.onRollOut=mango.onRollOut;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement