Kali ini kita kita akan belajar membuat game yang nantinya bisa kamu kembangkan sendiri.Penulis hanya membuat sample ini supaya kamu bisa menciptakan sendiri game yang lebih bagus.Game ini sangat simple dengan tampilan 2 dimensi menggunakan scipt kode di VB. Ada tiga option yang bisa dipilih yaitu :
1) Start
2) Options
3) The Game
Komponen yang digunakan
1) Timer Control
2) Picture Control
3) Label Control
4) Windows Media ocx
Untuk bermain game ini hanya menggunakan tombol arah serta tombol spasi. Silakan mencoba sendiri..
Dan berikut sample codenya :
Sorce Code :Option Explicit Dim u, d, l, r, showm As Boolean Dim x, y As Integer Dim mx, my As Integer Dim ex, ey As Integer Dim score As Long Dim fuel As Integer Dim es As Integer Private Sub Form_Load()'MediaPlayer1.playerApplication = App.Path & "\sfx\fire.wav" 'MediaPlayer2.FileName = App.Path & "\sfx\Explosion.wav" 'MediaPlayer3.FileName = App.Path & "\sfx\mainsound.mp3"lblScore.Caption = "0"x = 0 y = 0ex = -100 ex = -100es = 10fuel = 1 End Sub Private Sub Form_Paint() shooter.SetFocus End Sub Private Sub shooter_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 49 Then speed = speed - 1 If speed <= 0 Then speed = 0 If speed > 30 Then speed = 30 If KeyCode = 50 Then speed = speed + 1 If KeyCode = vbKeyLeft Then l = True If KeyCode = vbKeyRight Then r = True If KeyCode = vbKeyUp Then u = True If KeyCode = vbKeyDown Then d = True If KeyCode = vbKeySpace Then If Not showm Then fireit End If End If If KeyCode = vbKeyEscape Then Unload Me: End End Sub Private Sub shooter_KeyUp(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyLeft Then l = False If KeyCode = vbKeyRight Then r = False If KeyCode = vbKeyUp Then u = False If KeyCode = vbKeyDown Then d = False End Sub Private Sub Timer1_Timer()Static ch As Boolean ch = Not chIf ch Then shooter.Picture = Picture2.Picture Else shooter.Picture = Picture3.Picture End If End Sub Private Sub Timer2_Timer() If l Then x = x - speed If x < x =" 0" x =" x">= Me.ScaleWidth - 100 Then x = Me.ScaleWidth - 100 End If If u Then y = y - speed If y < y =" 0" y =" y">= Me.ScaleHeight - 100 Then y = Me.ScaleHeight - 100 End If Label5.Caption = "X = " & x Label6.Caption = "Y = " & y shooter.Left = x shooter.Top = y Label3.Caption = CStr(speed) If showm Then mx = mx + 20 If mx > Me.ScaleWidth Then showm = False fire.Visible = False End If fire.Left = mx fire.Top = my If (my > ey And my <> ex) Then score = score + 10 showm = False SetEn End If Else fire.Visible = False End If ex = ex - es en.Left = ex If ex < -200 Then SetEn en.Top = ey End If lblScore = CStr(score) Label8.Caption = "EX = " & ex Label7.Caption = "EY = " & ey If (y > ey - 40 And y <> ex And x < fuel =" fuel"> 1 Then MediaPlayer2.Play Picture1.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) SetEn Select Case fuel Case 2 Image1.Picture = LoadPicture(App.Path & "\data\fuel50.gif") Case 3 Image1.Picture = LoadPicture(App.Path & "\data\fuel20.gif") Case 4 Image1.Picture = LoadPicture(App.Path & "\data\game-over.gif") End Select If fuel = 4 Then MsgBox "Game Over", vbCritical, "Shooter" Unload Me Form2.Show End If End If End Sub Private Sub fireit() 'MediaPlayer1.Play showm = Truemx = shooter.Left + 100 my = shooter.Top + 50 fire.Visible = True End Sub Public Sub SetEn() ey = Int(Rnd * Me.ScaleHeight) - 100 ex = Me.ScaleWidth en.Left = ex en.Top = ey End Sub Private Sub Timer3_Timer() es = es + 5 End Sub
Silahkan Download
Visual Basic :
Silahkan Download
Info Penting : Di harapkan Downloadnya dengan menggunakan Internet Download Manager, Supaya anda dapat mendownloadnya dengan cepat
Sumber : Blazetorm
2 komentar to "Membuat Game Dengan Visual Basic 6"
Saya adalah Seorang anak muda berumur 16 tahun yang sebentar lagi 17 tahun di bulan juni ini saya dahalu punya blog juga ini blog ketiga saya blog lama saya semua tentang cheat saya bosen posting cheat jadi saya pindah aliran ke software kenapa saya pindah? karena kalau software itu tidak akan mati sedangkan cheat pasti ada pasang surutnya jadi saya harap dengan membuat blog Software Gratis ini bisa bermanfaat buat masbro :D regards JohnBrotha
Translate This
Jam Blog saya
Followers
Jenis-Jenis Thread
- Software Gratis (83)
- Software Hacking (4)
- Tips dan Trik Blogers (20)
- Tips dan Trik Hacking (3)
Blog Archive
-
▼
2011
(110)
-
▼
Mei
(25)
- Mengganti Nama Processor ( Khusus yang sering otak...
- PC Optimizer Pro 6.1.4.5 Full ( Patch + Keygen )
- Download Lebih Cepat dari IDM ( with DownThemAll )
- WinTools.net Ultimate 11.5.1 Full ( Keygen + Patch...
- Duckload Premium Account Trick + Free Premium Account
- PC Tools Spyware Doctor with AntiVirus 2011 8.0.0....
- Advanced Registry Clear v2.1.7.2 Full ( Keygen + P...
- Client for Google Translate Pro 5.1.551 Full ( Key...
- Reg Organizer v5.20 Full ( Keygen + Patch )
- SHARE PCMAV 5.1 Valhalla (Mei 2011)
- DU Super Controler v1.9 ( Full Version )
- Exe Wrapper v3.0 Full ( Keygen + Patch )
- KeyProwler 6.0 Incl ( Patcher )
- GameThrust Full ( Keygen )
- Kode-Kode Rahasia Blackberry
- 3D Image Effect Creation v1.20(FuLL)
- Membuat Game Dengan Visual Basic 6
- How To Recover Facebook Password ??
- YouTube Music Downloader v3.7.3 Full Version (Port...
- Link Generator 4Shared ( Premium )
- CoolwareMax Face Off Max 3.2.6.2 Full ( Patch Keyg...
- Google Earth Pro Plus 6.0.2.2074 ( Final Full Pat...
- Rainlendar Pro v2.8.1 ( Full Keygen With Skins )
- Advanced Password Manager 2.33 ( Full Crack )
- Wtrans ( Membuat Transparan )
-
▼
Mei
(25)
the MORTEN says:
kurang jelas gan penjelasan nya....
oriibcahhtimoer says:
bnerr nihh gk jls pn1lasan.a