Results 1 to 2 of 2

Thread: [ASK] mengubah arah gerak movie Clip random

  1. #1
    Erlan01 is offline Anggota BabaFlash
    Join Date
    May 2012
    Posts
    8

    Default [ASK] mengubah arah gerak movie Clip random

    saya mau bikin game yang menghindari musuh musuh gitu. tapi saya dapet sample dari temen, movie clipnya malah bergerak dari atas ke bawah, sedangkan saya inginnya dari kanan ke kiri. tolong dong cara ngubahnya gimana yah


    nih contoh SWF nya (musuhnya bergerak dari atas kebawah):
    http://warungflash.com/wp-content/up...2009/03/mo.swf

    dan ini script yang pengen diubah:

    function buatbom() { //menempatkan movie clip berlinkage bom ke stage dengan posisi x di koordinat acak 300 dan posisi y di koordinat -50
    animasi_bom = attachMovie("bom", "bom"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:random(300), _y:-50});
    animasi_bom.onEnterFrame = function() {
    //kecepatan turun
    this._y += speed;
    //jika menabrak movie clip pemain
    if (this.hitTest(pemain)) {
    //nilai waktu_hidup diubah menjadi false
    waktu_hidup = false;
    //mainkan frame berlabel gameover
    gotoAndStop("gameover");
    //hentikan
    clearInterval(Int);
    }
    //jika frame berada di lebih dari frame 12
    if (_currentframe>12) {
    //hapus movie clip ini
    removeMovieClip(this);
    }
    //jika posisi y movieclip ini lebih dari atau sama dengan 410
    if (this._y>=410) {
    //hapus movie clip ini
    removeMovieClip(this);
    }
    };
    }
    //jalankan function buatbom setiap hitungan 450
    Int = setInterval(buatbom, 450);

    TOLONG BANTUANNYA GAN
    JANGAN DIKACANGIN

  2. #2
    42Unregistered is offline Flash Geek
    Join Date
    Nov 2008
    Posts
    805

    Default

    kan sudah ada keterangannya
    ubah x >> y dan sebaliknya

    misalnya
    animasi_bom ... {_x:random(300), _y:-50}); >> {_x:1000, _y:random(300)});
    this._y += speed; >> this._x -= speed;

    dst

Similar Threads

  1. movie clip dalam movie clip
    By alarios in forum Flash CS3, CS4, CS5.5 dan Action Script 3
    Replies: 2
    Last Post: 06-28-2012, 07:57 PM
  2. [ASK] help kawan", memainkan movie clip dalam movie clip
    By zaborg99 in forum ActionScript 1.0/2.0
    Replies: 3
    Last Post: 09-07-2011, 07:09 PM
  3. tanya action script 2 buat moving random movie clip
    By mutia in forum ActionScript 1.0/2.0
    Replies: 4
    Last Post: 08-26-2011, 08:53 AM
  4. [help] gerak in movie clip ini
    By hotsoup in forum ActionScript 1.0/2.0
    Replies: 2
    Last Post: 06-11-2010, 11:12 AM
  5. merotasi movie clip
    By idham in forum Beginner
    Replies: 0
    Last Post: 08-06-2009, 02:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •