F Membuat game flash matematika sederhana / how to make a simple math flash game - galihghungs blog

Membuat game flash matematika sederhana / how to make a simple math flash game

Dalam tutorial ini kita akan membuat sebuah game aritmatika sederhana menggunakan flash. Anda dapat menggunakan Macromedia Flash 8 atau Adobe Flash CS 3 dalam pembuatannya.
In this tutorial, we will create asimple arithmetic flash game. You can use Macromedia Flash 8 or Adobe Flash CS 3.
Langkah 1: Buka sebuah file baru dengan ukuran default (550 x 440) , ubah warna background menjadi hijau. Buatlah sebuah tulisan judul "Online Test". Selanjutnya buatlah sebuah kotak berwarna merah dengan garis tepi putih. Perhatikan Gambar.
1st Step: Open a new file with the default size (550 x 440), change the background color to be green. Create a title with a text and type "Online Test". Then make a box with a red as a fill color and white as a stroke color. See a picture.
1Langkah 2 : Tambahkan di atas kotak merak tersebut dynamic text dan beri nama variabelnya "angka_1", Copy dynamic text tersebut dan pastekan di sampingnya, ubah nama variablenya menjadi "angka_2", sisipkan ditengah-tengahnya tanda tambah menggunakan static teks dan tanda sama dengan setelah teks angka_2. Kemudian buat lagi input teks dengan nama variabelnya "jawab", beri juga nama instance namenya dengan nama "answerBox" dan pilih "show border around text". Perhatikan gambar
2nd step : Add a dynamic text above red box and name it variable with "angka_1", Copy text, and paste a dynamic , change the variable name to "angka_2", Add a plus symbol with static text between two dynamic texts and also add a equal symbol after a second dynamic text, then make input text with variable name "jawab", also give the instance name with "answerBox" and select "show border around text". See a picture
2
Langkah 3 : buat 2 buah tombol di bawah kotak merah masing-masing dengan nama tombol random dan tombol check.
3rd step: create 2 button below the red box and name with a random button and check button.
3Langkah 4 : Buat sebuah movie clip dari static teks, misalnya "Correct Answer", beri nama instancenya "true_answer". Klik 2 kali movie clip tersebut untuk masuk ke area movie clip "true_answer", Klik frame 1, tahan dan geser ke frame 2, sehingga tidak ada objek di frame 1, lalu klik frame 10, klik kanan dan pilih insert keyframe. kembali ke frame 1 tekan tombol F9 dan masukkan kode berikut:
stop();
4th step: Create a movie clip from the static text,for example "Correct Answer", give the instance name with "true_answer". Click 2 times thisthe movie clip into movie clip area "true_answer", Click frame 1, hold and slide to the frame 2, so there is no object in the frame 1, then click on frame 10, right-click and select insert keyframe. Back to frame 1 and press F9 key and enter the following code:
stop ();
4
5Langkah 5 : Ulangi langkah 4 untuk jawaban yang salah, namun tulisannya adalah "Wrong Answer, try again". beri nama instancenya "wrong_answer".
5th step : Repeat step 4 for the wrong answers, but the letter is "Wrong answer, try again". give instance name with "wrong_answer".
6Langkah 6 : Kembali ke stage utama, tambahkan sebuah layer action, klik frame 1 layer action dan masukkan action script berikut:
6th Step: Back to the main stage, add a layer action, click action layer frame 1 and enter the following action script:
problem();
function problem() {
var _loc1 = 2+random(8);
var _loc2 = 2+random(8);
angka_1 = Math.floor(_loc1);
angka_2 = Math.floor(_loc2);
jawab = "";
Selection.setFocus(_root.answerBox);
stage.focus = _root.answerBox;
_root.answerBox.setSelection(0, 1);
}
function check_answer() {
if (angka_1+angka_2 == jawab) {
true_answer.play();
problem();
} else {
wrong_answer.play();
Selection.setFocus(_root.answerBox);
}
}
Langkah 7 : Klik tombol random dan masukkan action script berikut:
7th step : Click a random button and enter the following code:
on (press) {
problem();
}
Langkah 8: Klik tombol check dan masukkan action script berikut:
8th step : Click a check button and enter the following code:
on (press) {
check_answer();
}

Silahkan test movie, jika langkah di atas benar, maka hasilnya adalah sebagai berikut
Try to test movie, if the above steps correctly, the results are as follows:

CONVERSATION

0 comments:

Posting Komentar