Laporan Pembuatan Game Tower Bloxx

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

LAPORAN PEMBUATAN GAME TOWER BLOXX

Disusun Untuk Memenuhi Tugas Struktur Data


Dosen pengampu Indah Nofikasari, M.Kom
Teknik Informatika

Disusun Oleh :
Alam Prasetyo Aji 170103014
Agung Hadi Utomo 170103006
Muh Naufal W 170103130

UNIVERSITAS DUTA BANGSA SURAKARTA


FAKULTAS KOMPUTER
2018
KONSEP

Di konsep permainan “Tower Bloxx” menggunakan konsep stack suatu tumpukan dari benda, susunlah
15 kotak kotakmu serapi mungkin, jangan sampai kotak yang akan disusun meleset / jatuh agar
mencapai skor yang baik, tellitilah untuk menjatuhkan untuk memainkan game inikotaknya, perlu
ketelitian .

Untuk memainkan game ini tap tombol space untuk menjatuhkan kotak tersebut agar tersusun yang
rapi.

FLOWCHART

STAR

GAME TOWER BLOXX

SCORE

STAR

Tampilan form
Tampilan Game Play

Script
Dim rev As Boolean, Lastone As Boolean, noanim As Boolean

Dim CBLOCK As Byte, SYC As Integer, BAlive(255) As Boolean, LastLand As Byte

Dim TWrong As Byte, TCorrect As Byte, TBlocks As Byte, TRemain As Byte, Goal As Byte

Sub Annoy(mID As Byte)

Select Case mID

Case 0

PLand_T.ForeColor = vbBlack

PLand_T.Caption = "Sudah Siap?"

Case 1

PLand_T.ForeColor = vbBlue

PLand_T.Caption = "Hebat Sekali!"

Case 2

PLand_T.ForeColor = vbRed

PLand_T.Caption = "Kurang Beruntung!"

Case 3
PLand_T.ForeColor = vbBlack

PLand_T.Caption = "Hey Hey TAYOO!"

cmdU.Visible = True

cmdD.Visible = True

End Select

PLand_T.Visible = True

PLand.Enabled = True

End Sub

Sub DropBlock()

'if a block is still falling, stop the procedure

If BlockLever.Enabled = True Or Lastone = True Then Exit Sub

If TRemain - 1 = 0 Then

'stop crane

CCMove.Enabled = False

'hide mother block

Block(0).Visible = False

'hide crane cable

CraneCable.Visible = False

Lastone = True

Call Annoy(3)

End If

'load a new one

CBLOCK = CBLOCK + 1

Load Block(CBLOCK) 'load block

Block(CBLOCK).ZOrder

Block(CBLOCK).Visible = True
BlockLever.Enabled = True

'every 2 correct blocks, screen goes up

'set total

TBlocks = CBLOCK

lbTotal.Caption = TBlocks

'show remaining

TRemain = Goal - TBlocks

lbRemain.Caption = TRemain

End Sub

Private Sub BlockLever_Timer()

Block(CBLOCK).Top = Block(CBLOCK).Top + 150

If CBLOCK = 1 Then

If Block(CBLOCK).Top + Block(CBLOCK).Height >= BaseBlock.Top Then

BlockLever.Enabled = False

BAlive(CBLOCK) = True

LastLand = 1

'annoy the correct

TCorrect = TCorrect + 1

lbCorrect.Caption = TCorrect

End If

Else

'Y offset X Position


If Block(CBLOCK).Top + Block(CBLOCK).Height >= Block(LastLand).Top - 150 And Block(CBLOCK).Left
> Block(LastLand).Left - (Block(CBLOCK).Width \ 2) And Block(CBLOCK).Left < Block(LastLand).Left +
Block(LastLand).Width - (Block(CBLOCK).Width \ 2) Then

BlockLever.Enabled = False

BAlive(CBLOCK) = True

'dock to correct y position

Block(CBLOCK).Top = Block(LastLand).Top - Block(CBLOCK).Height

'dock to correct x position on low differece

If Block(CBLOCK).Left > Block(LastLand).Left - 200 And Block(CBLOCK).Left < Block(LastLand).Left +


200 Then

Block(CBLOCK).Left = Block(LastLand).Left

'Perfect Land!

Call Annoy(1)

End If

LastLand = CBLOCK

'increment corrects

TCorrect = TCorrect + 1

lbCorrect.Caption = TCorrect

'every 2 correct blocks, screen goes up

If TCorrect Mod 2 = 0 Then ScreenAnim.Enabled = True

'last block

If TRemain = 1 Then

Block(0).Picture = LoadPicture("E:\game numpuk omh\New folder\Bloxx\pic\HBlock.bmp")

End If

End If

End If
'if out

If Block(CBLOCK).Top > Me.Height Then

BlockLever.Enabled = False 'stop the lever

BAlive(CBLOCK) = False 'this block is dead

TWrong = TWrong + 1

lbWrong.Caption = TWrong

'last block

If TRemain = 1 Then

Block(0).Picture = LoadPicture("E:\game numpuk omh\New folder\Bloxx\pic\HBlock.bmp")

End If

Call Annoy(2)

End If

End Sub

Private Sub CCMove_Timer()

If rev Then

'go right

Block(0).Left = Block(0).Left + 100

CraneCable.X2 = Block(0).Left + (Block(0).Width \ 2)

If Block(0).Left > BaseBlock.Left + BaseBlock.Width - (Block(0).Width \ 2) Then rev = False

Else

'go left

Block(0).Left = Block(0).Left - 100

CraneCable.X2 = Block(0).Left + (Block(0).Width \ 2)

'y wave under construction!

If Block(0).Left < BaseBlock.Left - (Block(0).Width \ 2) Then rev = True


End If

'Me.Caption = rev

End Sub

Private Sub cmdD_Click()

ScreenAnim.Enabled = True

End Sub

Private Sub cmdU_Click()

noanim = True

ScreenAnim.Enabled = True

End Sub

Private Sub Command1_Click()

If (MsgBox("Yakin Keluar?", vbYesNo, "Keluar") = vbYes) Then

Unload Me

End If

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeySpace Then Call DropBlock 'drop the block when space key is hit

End Sub

Private Sub Form_Load()

CBLOCK = 0

rev = False 'move forward

Goal = 15 'max blocks

cmdU.Visible = False 'hide UP button

cmdD.Visible = False 'hide DOWN button


TRemain = Goal - TBlocks 'calculate remaining blocks

Call Annoy(0) 'show a message

End Sub

Private Sub PLand_Timer()

PLand_T.Visible = False 'hide message

PLand.Enabled = False 'disable the timer

End Sub

Private Sub ScreenAnim_Timer()

SYC = SYC + 1

jump = 225

If noanim Then jump = -225

For i = 1 To CBLOCK

'if block is alive

If BAlive(i) Then Block(i).Top = Block(i).Top + jump

Next i

BaseBlock.Top = BaseBlock.Top + jump

If SYC = 10 Then

noanim = False

SYC = 0

ScreenAnim.Enabled = False

End If

End Sub

You might also like