วันจันทร์ที่ 26 มกราคม พ.ศ. 2558

script ในตัวหนอน หรือ ผลไม้ หล่นลงมา

onClipEvent (load) {
 function reset() {
 if (this._name == "worm") {
 this._visible = false;
 } else {
 this._visible = true;
 }
 this.dead = 0;
 this.speed = random(2)+2;
 this._y = 0;
 this._x = random(1000);
 }
 this.reset();
}
onClipEvent (enterFrame) {
 this._y+= this.speed;
 if (this._y>768) {
 this.reset();
 }
}

duplicateMovieClip จับเวลา countdown

for (i=1; i<=5; i++) {
 _root["orange"].duplicateMovieClip("orange"+i, _root.getNextHighestDepth());
 _root["worm"].duplicateMovieClip("worm"+i, _root.getNextHighestDepth());
}
stop();
timer = 30;
countdown = function () {
 timer--;
 if (timer == 0) {
 clearInterval(countdownInterval);
 gotoAndStop(2);
 }
};
countdownInterval = setInterval(countdown, 1000);

player mc เลื่อน ซ้ายขวา hit เก็บผลไม้ ได้คะแนน

player mc
เลื่อน ซ้ายขวา   hit  เก็บผลไม้ ได้คะแนน

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
if (_x>0) {
_x -= 10;
}
}
if (Key.isDown(Key.RIGHT)) {
if (_x<900) {
_x += 10;
}
}
for (i=1; i<=5; i++) {
if (this.hitTest(_root["orange"+i]) && _root["orange"+i].dead == 0) {
_root["orange"+i].gotoAndPlay(2);
_root.score++;
}
if (this.hitTest(_root["worm"+i]) && _root["worm"+i].dead == 0) {
_root["worm"+i].gotoAndPlay(2);
_root.score--;
}
}
}

วันอาทิตย์ที่ 25 มกราคม พ.ศ. 2558

สร้าง movie clip ลูกบอล หล่นลงมา

flash 8

สร้าง movie clip ลูกบอล หล่นลงมา
   สร้าง movie clip กด f9  ใส่ code ที่ mc

onClipEvent (load) {
function reset(){
this._y=0;
this._x=random(1024);
}
 i = random(9)+1;
}

onClipEvent (enterFrame) {
 this._y += i;

 if (this._y>768){
this.reset();
 }
}

poke scarlet pokedex

 https://www.dualshockers.com/pokemon-scarlet-violet-full-pokedex/ [001 Sprigatito] 08000000 03075530 00000000 0000038A [002 Floragato] 0800...