Making of Bouncing Ball TikTok Effect
Catatan: Belum ada tambahan penjelasan di dalam video, baru berupa rekaman layar
[ID]
- Saat Bola menyentuh Papan, lakukan beberapa hal berikut :
- Bunyikan suara
- Naikkan nilai counter untuk menghitung skor
- Tampilkan di teks skor
- Berikan gaya ke atas (nilai Y) agar bola terlihat memantul tinggi
- Berikan gaya acak ke samping (nilai X) agar pantulan agak berubah untuk menambah tantangan
[EN]
- When the ball hits the board, do the following :
- Play the audio
- Increase the counter value to calculate the score
- Show the score text
- Apply an upward force (Y value) to make the ball look like it is bouncing higher
- Apply a random force to the side (X value) to make the bounce change slightly to add to the challenge
[ID]
- Deteksi pergerakan wajah
- Ambil nilai X saja, karena papan cuma bergerak secara horisontal
Nilai terkecil posisi wajah paling kiri adalah 0, dan paling kanan adalah 1. Sedangkan posisi papan adalah 0 saat di tengah layar, -20 saat di ujung kiri dan 20 saat di ujung kanan. Oleh karena itu nilai posisi wajah harus dikonversi dengan rumus.
Xpapan = Xwajah * 40 - 20Sehingga diterapkan dalam script:
- Kalikan dengan 40 (B = 40)
- Kurangi dengan 20 (B = 40)
- Gabungkan nilai X (berdasarkan pergerakan wajah) dengan nilai Y (tetap -15) dan Z tetap 0.
- Set posisi papan berdasarkan nilai yang sudah diperoleh sebelumnya.
[EN]
- Detect face movement
- Take the X value only, because the board only moves horizontally
The smallest value of the leftmost face position is 0, and the rightmost is 1. While the board position is 0 when in the middle of the screen, -20 when on the left end and 20 when on the right end. Therefore the face position value must be converted with the formula.
Xboard = Xface * 40 - 20So that it is applied in the script:
- Multiply by 40 (B = 40)
- Subtract by 20 (B = 40)
- Combine the X value (from face movement) with the Y fixed -15 and Z is 0.
- Set the board position based on the previously obtained value.

