Nama : Kevin Ashil F NRP : 05111740000178 Kelas : PBO - B Membuat Game Pong Menggunakan Java Untuk membuat game sederhana berupa game Pong, maka dibutuhkan beberapa kelas yakni 1. Ball untuk bola 2. Paddle untuk pemukul 3. Render untuk merender grafiknya 4. Pong untuk meload seluruh nya. Berikut kelasnya 1. Ball import java.awt.Color ; import java.awt.Graphics ; import java.util.Random ; public class Ball { public int x , y , width = 25 , height = 25 ; public int motionX , motionY ; public Random random ; private Pong pong ; public int amountOfHits ; public Ball ( Pong pong ) { this . pong = pong ; this . random = new Random (); spawn (); } public void update ( Paddle paddle1 , Paddle paddle2 ) { int speed = 5 ; this . x += motionX * speed ; this . y += moti...
Pembuatan Aplikasi berbasis Android Aplikasi tentang Kamera dan Sensor GPS Kevin Ashil Faadilah 05111740000178 PBO-B Deskripsi singkat : Aplikasi ini memuat tentang Kamera yang dapat menangkap foto dan deteksi lokasi melalui Koordinat yang dimana menggunakan Sensor GPS disediakan oleh library pada android. Source Code dibagi menjadi dua, yaitu a. Source Code Tampilan menggunakan file .xml <? xml version ="1.0" encoding ="utf-8" ?> <androidx.constraintlayout.widget.ConstraintLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" tools :context ="com.example.cobakamera.MainActivity" > <Button android :id ="@+id/btnAmbil" android :layout_width ="...
Komentar
Posting Komentar