Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim x, y, dx, dy, s As Double
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- x += dx
- y += dy
- If x >= Me.ClientSize.Width - s Then
- x = Me.ClientSize.Width - s
- dx = -dx
- ElseIf x < 0 Then
- x = 0
- dx = -dx
- End If
- If y >= Me.ClientSize.Height - s Then
- y = Me.ClientSize.Height - s
- dy = -dy
- ElseIf y < 0 Then
- y = 0
- dy = -dy
- End If
- Me.Refresh()
- End Sub
- Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
- Dim g As Graphics = e.Graphics
- Dim x, y, s As Integer
- x = Me.x
- y = Me.y
- s = Me.s
- g.FillEllipse(Brushes.Navy, x, y, s, s)
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- x = 40
- y = 90
- dx = 1
- dy = 1
- s = 10
- Timer1.Enabled = True
- End Sub
- End Class
- ' MATERI ( pilih sampai nilai = 18 saja )
- ' 1. 3 poin ( tombol atas bawah (x) kiri kanan (y) mengubah kecepatan bola )
- ' 2. 3 poin ( tombol W S A D mengubah posisi bola )
- ' 3. 7 poin ( tombol + dan - menambah jumlah bola, max bola = 10, arah bola random )
- ' 4. 3 poin ( ketika window tidak aktif, bola berhenti )
- ' 5. 3 poin ( klik mouse pada suatu tempat mengubah posisi bola )
- ' 6. 3 poin ( tombol 1-9 mengubah ukuran bola ) --> HARAM u/ PR
- ' 7. 5 poin ( klik kanan mouse pada suatu tempat mengubah arah pergerakan bola )
- ' PR ( pilih sampai nilai = 9 saja )
- ' 1. 3 poin ( yang memantul = 3 buah gambar ) WAJIB
- ' 2. 5 poin ( gambar terdapat transparansi dan tidak ngeblink )
- ' 3. 3 poin ( 0-9 memilih gambar yg ada (diberi border) )
- ' 4. lain2 ( poin2 MATERI dibagi 2 di floor )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement