'*************************************************
'
' Encrypt File Utility
' Copyright (C) 1995,1996 MagicTouch Software Inc.
'
'*************************************************
ON ERROR GOTO error.trap
CLS
LOCATE 1, 1
COLOR 10, 0
PRINT "Encrypt File Utility Release 1.1"
PRINT "Copyright (C) 1995 MagicTouch Software Inc. "
COLOR 15, 0
INPUT "Enter File name : ", filespec$
IF filespec$ = "" THEN END
OPEN "R", #1, filespec$, 1
FIELD #1, 1 AS f$
Norec = LOF(1)
IF Norec = 0 THEN
BEEP
COLOR 5, 0
PRINT "File Not Found... "
CLOSE
COLOR 7, 0
END
END IF
OPEN "R", #2, "ENCRYPT.DAT", 1
FIELD #2, 1 AS g$
d$ = ""
x1 = 1: y1 = 1
GOSUB Unencrypt
enc$ = "Encrypting"
PRINT "File has not encrypted."
INPUT "Encrypt File ? [Y/N] ", jwb$
IF jwb$ = "Y" OR jwb$ = "y" THEN
RSET g$ = "%"
PUT #2, y1
y1 = y1 + 1
GOTO Process
END IF
CLOSE
KILL "ENCRYPT.DAT"
END
Process:
WHILE x1 <= Norec
GET #1, x1
a = ASC(f$) XOR 12
d$ = CHR$(a)
RSET g$ = d$
PUT #2, y1
LOCATE 9, 1
PRINT enc$; y1; " bytes"
x1 = x1 + 1
y1 = y1 + 1
WEND
CLOSE
KILL filespec$
NAME "ENCRYPT.DAT" AS filespec$
COLOR 14, 0
PRINT "Success... "
FOR p = 1 TO 6
SOUND 5000, 1
SOUND 4000, 1
NEXT
FOR Delay = 1 TO 2000
NEXT
COLOR 7, 0
END
Unencrypt:
GET #1, 1
IF f$ = "%" THEN
PRINT "File already encrypted."
INPUT "Unencrypt File ? [Y/N] ", jwb$
IF jwb$ = "Y" OR jwb$ = "y" THEN
x1 = x1 + 1
enc$ = "Unencrypting"
GOTO Process
END IF
CLOSE
KILL "ENCRYPT.DAT"
END
END IF
RETURN
error.trap:
DEF SEG
z% = ERDEV
e = PEEK(VARPTR(z%))
IF e = 2 THEN
PRINT "Drive not ready... Press any key to continue..."
a$ = INPUT$(1)
RUN
END IF
IF e = 0 THEN
PRINT "Write protected error... Press any key to continue..."
a$ = INPUT$(1)
RUN
END IF
[ add comment ] | permalink |




( 0 / 0 )Di era DOS dulu, kita mengenal file AUTOEXEC.BAT yang berfungsi untuk menjalankan file executable (file-file dengan ekstensi EXE, COM atau BAT) secara otomatis. Waktu itu saya pernah membuat program untuk menampilkan tips-tips yang berganti setiap harinya. Berikut adalah listing programnya, mungkin bisa memberikan inspirasi buat kita semua...
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
'
' " Here's Your Tips for Today "
'
' Created by Yulius Candra Wahyu Kurniawan
' Last edited : August, 1995
' Copyright (C) 1995 MagicTouch Software Inc.
' All Rights Reserved
'
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
DECLARE SUB Center (Row, Fore, Back, Text$)
DECLARE SUB CheckTips ()
DECLARE SUB SetCursor (Row, Col, Fore, Back)
DECLARE SUB Tips.1 ()
DECLARE SUB Tips.2 ()
DECLARE SUB Tips.3 ()
DECLARE SUB Tips.4 ()
DECLARE SUB Tips.5 ()
DECLARE SUB Tips.6 ()
DECLARE SUB Tips.7 ()
DECLARE SUB Tips.8 ()
DECLARE SUB Tips.9 ()
DECLARE SUB Tips.10 ()
DECLARE SUB Tips.11 ()
DECLARE SUB Tips.12 ()
DECLARE SUB Tips.13 ()
DECLARE SUB Tips.14 ()
DECLARE SUB Tips.15 ()
DECLARE SUB Tips.16 ()
DECLARE SUB Tips.17 ()
DECLARE SUB Tips.18 ()
DECLARE SUB Tips.19 ()
DECLARE SUB Tips.20 ()
DECLARE SUB Tips.21 ()
DECLARE SUB Tips.22 ()
DECLARE SUB Tips.23 ()
DECLARE SUB Tips.24 ()
DECLARE SUB Tips.25 ()
DECLARE SUB Tips.26 ()
DECLARE SUB Tips.27 ()
DECLARE SUB Tips.28 ()
DECLARE SUB Tips.29 ()
DECLARE SUB Tips.30 ()
DECLARE SUB Tips.31 ()
DECLARE SUB TypeChar (Row, Fore, Back, Text$)
CONST Pesan$ = "H.a.v.e. a. W.o.n.d.e.r.f.u.l. D.a.y"
CLS
CheckTips
SUB Center (Row, Fore, Back, Text$)
Col = INT((80 - LEN(Text$)) / 2)
LOCATE Row, Col
COLOR Fore, Back
PRINT Text$;
END SUB
SUB CheckTips
DIM CDow$(8)
CTime$ = TIME$
CHours$ = LEFT$(CTime$, 2)
CDay$ = DATE$
CDate$ = MID$(CDay$, 4, 2)
CMonth$ = LEFT$(CDay$, 2)
CYear$ = RIGHT$(CDay$, 4)
Year = VAL(CYear$)
Month = VAL(CMonth$)
Day = VAL(CDate$)
Var.1 = Month - 2 - 12 * (Month < 3)
Var.2 = Year + (Month < 3)
Var.3 = INT(Var.2 / 100)
Var.2 = Var.2 - 100 + Var.3
Dow = INT(2.61 * Var.1 - .2) + Day + Var.2 + INT(Var.2 / 4)
Dow = (Dow + INT(Var.3 / 4) - Var.3 - Var.3 + 77) MOD 7 + 1
CDow$(1) = "Monday"
CDow$(2) = "Tuesday"
CDow$(3) = "Wednesday"
CDow$(4) = "Thursday"
CDow$(5) = "Friday"
CDow$(6) = "Saturday"
CDow$(7) = "Sunday"
IF CMonth$ = "01" THEN Month$ = "January"
IF CMonth$ = "02" THEN Month$ = "February"
IF CMonth$ = "03" THEN Month$ = "March"
IF CMonth$ = "04" THEN Month$ = "April"
IF CMonth$ = "05" THEN Month$ = "May"
IF CMonth$ = "06" THEN Month$ = "June"
IF CMonth$ = "07" THEN Month$ = "July"
IF CMonth$ = "08" THEN Month$ = "August"
IF CMonth$ = "09" THEN Month$ = "September"
IF CMonth$ = "10" THEN Month$ = "October"
IF CMonth$ = "11" THEN Month$ = "November"
IF CMonth$ = "12" THEN Month$ = "December"
IF CHours$ >= "04" AND CHour$ <= "10" THEN
Greeting$ = "G.o.o.d. M.o.r.n.i.n.g"
END IF
IF CHours$ >= "11" AND CHour$ <= "14" THEN
Greeting$ = "G.o.o.d. A.f.t.e.r.n.o.o.n"
END IF
IF CHours$ >= "15" AND CHour$ <= "18" THEN
Greeting$ = "G.o.o.d. E.v.e.n.i.n.g"
END IF
IF CHours$ >= "19" AND CHour$ <= "03" THEN
Greeting$ = "G.o.o.d. N.i.g.h.t"
END IF
Center 1, 26, 0, Greeting$
Center 2, 26, 0, Pesan$
Center 3, 14, 0, "Created by Yulius Candra Wahyu Kurniawan"
Center 4, 14, 0, "Copyright (C) 1995 MagicTouch Software Inc."
Text$ = "It is a Lovely " + CDow$(Dow) + ", on " + Month$ + " " + CDate$ + " " + CYear$
Center 5, 11, 0, Text$
Center 6, 13, 0, "Here's Your Tips for Today :"
IF CDate$ = "01" THEN Tips.1
IF CDate$ = "02" THEN Tips.2
IF CDate$ = "03" THEN Tips.3
IF CDate$ = "04" THEN Tips.4
IF CDate$ = "05" THEN Tips.5
IF CDate$ = "06" THEN Tips.6
IF CDate$ = "07" THEN Tips.7
IF CDate$ = "08" THEN Tips.8
IF CDate$ = "09" THEN Tips.9
IF CDate$ = "10" THEN Tips.10
IF CDate$ = "11" THEN Tips.11
IF CDate$ = "12" THEN Tips.12
IF CDate$ = "13" THEN Tips.13
IF CDate$ = "14" THEN Tips.14
IF CDate$ = "15" THEN Tips.15
IF CDate$ = "16" THEN Tips.16
IF CDate$ = "17" THEN Tips.17
IF CDate$ = "18" THEN Tips.18
IF CDate$ = "19" THEN Tips.19
IF CDate$ = "20" THEN Tips.20
IF CDate$ = "21" THEN Tips.21
IF CDate$ = "22" THEN Tips.22
IF CDate$ = "23" THEN Tips.23
IF CDate$ = "24" THEN Tips.24
IF CDate$ = "25" THEN Tips.25
IF CDate$ = "26" THEN Tips.26
IF CDate$ = "27" THEN Tips.27
IF CDate$ = "28" THEN Tips.28
IF CDate$ = "29" THEN Tips.29
IF CDate$ = "30" THEN Tips.30
IF CDate$ = "31" THEN Tips.31
SetCursor 13, 1, 7, 0
END SUB
SUB SetCursor (Row, Col, Fore, Back)
LOCATE Row, Col
COLOR Fore, Back
END SUB
SUB Tips.1
TypeChar 8, 15, 0, "Bring supply when you go, but"
TypeChar 9, 15, 0, "bring charity when you die"
END SUB
SUB Tips.10
TypeChar 8, 15, 0, "Think to day and speak tomorrow"
END SUB
SUB Tips.11
TypeChar 8, 15, 0, "Give your smile to everyone, but"
TypeChar 9, 15, 0, "give your love only for one person"
END SUB
SUB Tips.12
TypeChar 8, 15, 0, "Love which begun with high soul flame,"
TypeChar 9, 15, 0, "often would end with cold and frozen"
END SUB
SUB Tips.13
TypeChar 8, 15, 0, "Love is a wheel that crush everyone who follow his movement"
TypeChar 9, 15, 0, "but without its crush we can't feel how beautiful of life"
END SUB
SUB Tips.14
TypeChar 8, 15, 0, "True love is which only for two persons and"
TypeChar 9, 15, 0, "haven't the place for third person"
END SUB
SUB Tips.15
TypeChar 8, 15, 0, "Life is not valuable for someone who doesn't have true friend"
END SUB
SUB Tips.16
TypeChar 8, 15, 0, "When you can't get your idea on one way,"
TypeChar 9, 15, 0, "get it on another way"
END SUB
SUB Tips.17
TypeChar 8, 15, 0, "Don't be affraid if you only failed once,"
TypeChar 9, 15, 0, "Edison has failed ten thousand times before"
TypeChar 10, 15, 0, "he succeeded in making an electric lamp"
END SUB
SUB Tips.18
TypeChar 8, 15, 0, "Don't forget experiences what have gone away"
TypeChar 9, 15, 0, "but use those experiences as leader for the future"
END SUB
SUB Tips.19
TypeChar 8, 15, 0, "A true companion is loving all the time"
TypeChar 9, 15, 0, "and is a brother in difficulty"
END SUB
SUB Tips.2
TypeChar 8, 15, 0, "Don't so sad because everyone don't know you"
TypeChar 9, 15, 0, "but try so that you can be know"
END SUB
SUB Tips.20
TypeChar 8, 15, 0, "Don't buy friends with presents,"
TypeChar 9, 15, 0, "if you stop giving then they'll stop loving"
END SUB
SUB Tips.21
TypeChar 8, 15, 0, "The good man is the man who is feel shy"
TypeChar 9, 15, 0, "when his words are more than his action"
END SUB
SUB Tips.22
TypeChar 8, 15, 0, "The wise man always think about what is wrong on himself"
TypeChar 9, 15, 0, "and doesn't like to think about mistake of the others"
END SUB
SUB Tips.23
TypeChar 8, 15, 0, "Take care of your idea well..."
TypeChar 9, 15, 0, "When your idea are lost it's the same with death"
END SUB
SUB Tips.24
TypeChar 8, 15, 0, "The time can make us very happy, but"
TypeChar 9, 15, 0, "it's also make us in sorrow and suffering"
END SUB
SUB Tips.25
TypeChar 8, 15, 0, "The secret of every success is always steady"
TypeChar 9, 15, 0, "to catch the opportunity when it appears"
END SUB
SUB Tips.26
TypeChar 8, 15, 0, "Some work that you do, don't stop before get the product"
END SUB
SUB Tips.27
TypeChar 8, 15, 0, "Good treat for the man who ever annoy for you,"
TypeChar 9, 15, 0, "exactly one day he would appologize for you"
END SUB
SUB Tips.28
TypeChar 8, 15, 0, "Fighting with another makes war, but"
TypeChar 9, 15, 0, "struggling with one's self bring peace"
END SUB
SUB Tips.29
TypeChar 8, 15, 0, "Don't feel well be hold by earth so that you get trouble,"
TypeChar 9, 15, 0, "but let the earth in your handself that you can make shake it"
END SUB
SUB Tips.3
TypeChar 8, 15, 0, "Let not your tongue cut your throat"
END SUB
SUB Tips.30
TypeChar 8, 15, 0, "Fight the devil, it would go away from you"
END SUB
SUB Tips.31
TypeChar 8, 15, 0, "Remember... The work you don't like to do it today"
TypeChar 9, 15, 0, "not sure shall you do it tomorrow"
END SUB
SUB Tips.4
TypeChar 8, 15, 0, "Only with the sufferings of life can teach the people"
TypeChar 9, 15, 0, "for give respect about goodness and the attractive of life"
END SUB
SUB Tips.5
TypeChar 8, 15, 0, "Love is beauty but not every beauty have love"
END SUB
SUB Tips.6
TypeChar 8, 15, 0, "The true love is like a ghost, almost all man speak it"
TypeChar 9, 15, 0, "but only some men ever really discover it"
END SUB
SUB Tips.7
TypeChar 8, 15, 0, "Love is a curious thing, when we catch it tight it would die"
TypeChar 9, 15, 0, "but if we catch it not so tight it would run away"
END SUB
SUB Tips.8
TypeChar 8, 15, 0, "Love make the weak man become strong"
TypeChar 9, 15, 0, "and the strong man become weak"
END SUB
SUB Tips.9
TypeChar 8, 15, 0, "Do for everything, so that we can make possible for that impossible"
END SUB
SUB TypeChar (Row, Fore, Back, Text$)
Col = INT((80 - LEN(Text$)) / 2)
FOR Counter = 1 TO LEN(Text$)
FOR Delay = 1 TO 800
NEXT
LOCATE Row, Col
COLOR Fore, Back
SOUND 8000, .5
PRINT MID$(Text$, Counter, 1);
Col = Col + 1
NEXT
END SUB
[ add comment ] | permalink |




( 0 / 0 )Perintah BSAVE di dalam QBasic digunakan untuk menyimpan memory layar ke dalam sebuah file, dimana file ini bisa kita load lagi, biasanya berguna untuk keperluan background. Langsung saja, berikut adalah contoh program yang ada dari qbasic.com
'The SUBroutine BSAVEExample shows how to BSAVE a picture.
'The rest of the program is an animation.
'
'GIF loading author is unknown.
'
'Taken from The QBasic Page at http://qbasic.com
'
'
DECLARE SUB BSAVEExample ()
DECLARE SUB GifLoad (a$)
GifLoad "palette.gif": CLOSE
DIM m1(6200)
DIM mallard(8000)
SCREEN 13
speed = 1000
DO
FOR i = 1 TO 8
IF x < 95 THEN x = x + 1: ELSE EXIT DO
'IF y < 50 THEN y = y + 1
DEF SEG = VARSEG(m1(0)): BLOAD "b" + LTRIM$(STR$(i)) + ".gfx", 0: DEF SEG
PUT (x, y), m1, PSET
ERASE m1
FOR j = 1 TO speed: NEXT
NEXT
LOOP
FOR z = 1 TO 3
FOR i = 1 TO 8
DEF SEG = VARSEG(m1(0)): BLOAD "b" + LTRIM$(STR$(i)) + ".gfx", 0: DEF SEG
PUT (x, y), m1, PSET
ERASE m1
FOR j = 1 TO speed: NEXT
NEXT
NEXT z
speed = speed - (speed \ 1.5)
DEF SEG = VARSEG(mallard(0)): BLOAD "mallard.gfx", 0: DEF SEG
x2 = 60
y2 = 119
DO
FOR i = 1 TO 8
IF y2 >= 80 THEN y2 = y2 - 1: ELSE EXIT DO
PUT (x2, y2), mallard, PSET
DEF SEG = VARSEG(m1(0)): BLOAD "b" + LTRIM$(STR$(i)) + ".gfx", 0: DEF SEG
PUT (x, y), m1, PSET
ERASE m1
FOR j = 1 TO speed: NEXT
NEXT
LOOP
speed = speed - (speed \ 2)
a = 101
DO
FOR i = 1 TO 8
DEF SEG = VARSEG(m1(0)): BLOAD "b" + LTRIM$(STR$(i)) + ".gfx", 0: DEF SEG
PUT (x, y), m1, PSET
ERASE m1
FOR j = 1 TO speed: NEXT
IF s < 60 THEN
s = s + 1: PALETTE s + 100, s: s = s + 1: PALETTE s + 100, s: s = s + 1: PALETTE s + 100, s
s = s + 1: PALETTE s + 100, s: s = s + 1: PALETTE s + 100, s: s = s + 1: PALETTE s + 100, s
END IF
IF s = 60 THEN
IF ajsaikj = 0 THEN speed = speed * 2: ajsaikj = 1
a = a + .25
IF a >= 160 THEN EXIT DO
COLOR INT(a)
LOCATE 18, 15
PRINT "presents"
END IF
NEXT
LOOP
i = 0
DO WHILE INKEY$ = ""
i = i + 1: IF i = 9 THEN i = 1
DEF SEG = VARSEG(m1(0)): BLOAD "b" + LTRIM$(STR$(i)) + ".gfx", 0: DEF SEG
PUT (x, y), m1, PSET
ERASE m1
FOR j = 1 TO speed: NEXT
LOOP
DEFINT A-Z
DEFSNG A-Z
SUB BSAVEExample
GifLoad "mallard.gif"
DIM mallard(10000)
GET (0, 0)-(200, 80), mallard
DEF SEG = VARSEG(mallard(0))
BSAVE "mallard.gfx", 0, 10000
DEF SEG
END SUB
SUB GifLoad (a$)
DEFINT A-Z
DIM Prefix(4095), Suffix(4095), OutStack(4095), shiftout%(8)
DIM Ybase AS LONG, powersof2(11) AS LONG, WorkCode AS LONG
FOR a% = 0 TO 7: shiftout%(8 - a%) = 2 ^ a%: NEXT a%
FOR a% = 0 TO 11: powersof2(a%) = 2 ^ a%: NEXT a%
IF a$ = "" THEN INPUT "GIF file"; a$: IF a$ = "" THEN END
IF INSTR(a$, ".") = 0 THEN a$ = a$ + ".gif"
OPEN a$ FOR BINARY AS #1
a$ = " ": GET #1, , a$
IF a$ <> "GIF87a" THEN PRINT "Not a GIF87a file.": END
GET #1, , TotalX: GET #1, , TotalY: GOSUB GetByte
NumColors = 2 ^ ((a% AND 7) + 1): NoPalette = (a% AND 128) = 0
GOSUB GetByte: Background = a%
GOSUB GetByte: IF a% <> 0 THEN PRINT "Bad screen descriptor.": END
IF NoPalette = 0 THEN P$ = SPACE$(NumColors * 3): GET #1, , P$
DO
GOSUB GetByte
IF a% = 44 THEN
EXIT DO
ELSEIF a% <> 33 THEN
PRINT "Unknown extension type.": END
END IF
GOSUB GetByte
DO: GOSUB GetByte: a$ = SPACE$(a%): GET #1, , a$: LOOP UNTIL a% = 0
LOOP
GET #1, , XStart: GET #1, , YStart: GET #1, , XLength: GET #1, , YLength
XEnd = XStart + XLength: YEnd = YStart + YLength: GOSUB GetByte
IF a% AND 128 THEN PRINT "Can't handle local colormaps.": END
Interlaced = a% AND 64: PassNumber = 0: PassStep = 8
GOSUB GetByte
ClearCode = 2 ^ a%
EOSCode = ClearCode + 1
FirstCode = ClearCode + 2: NextCode = FirstCode
StartCodeSize = a% + 1: CodeSize = StartCodeSize
StartMaxCode = 2 ^ (a% + 1) - 1: MaxCode = StartMaxCode
BitsIn = 0: BlockSize = 0: BlockPointer = 1
x% = XStart: y% = YStart: Ybase = y% * 320&
SCREEN 13: DEF SEG = &HA000
IF NoPalette = 0 THEN
OUT &H3C7, 0: OUT &H3C8, 0
FOR a% = 1 TO NumColors * 3: OUT &H3C9, ASC(MID$(P$, a%, 1)) \ 4: NEXT a%
END IF
LINE (0, 0)-(319, 199), Background, BF
DO
GOSUB GetCode
IF Code <> EOSCode THEN
IF Code = ClearCode THEN
NextCode = FirstCode
CodeSize = StartCodeSize
MaxCode = StartMaxCode
GOSUB GetCode
CurCode = Code: LastCode = Code: LastPixel = Code
IF x% < 320 THEN POKE x% + Ybase, LastPixel
x% = x% + 1: IF x% = XEnd THEN GOSUB NextScanLine
ELSE
CurCode = Code: StackPointer = 0
IF Code > NextCode THEN EXIT DO
IF Code = NextCode THEN
CurCode = LastCode
OutStack(StackPointer) = LastPixel
StackPointer = StackPointer + 1
END IF
DO WHILE CurCode >= FirstCode
OutStack(StackPointer) = Suffix(CurCode)
StackPointer = StackPointer + 1
CurCode = Prefix(CurCode)
LOOP
LastPixel = CurCode
IF x% < 320 THEN POKE x% + Ybase, LastPixel
x% = x% + 1: IF x% = XEnd THEN GOSUB NextScanLine
FOR a% = StackPointer - 1 TO 0 STEP -1
IF x% < 320 THEN POKE x% + Ybase, OutStack(a%)
x% = x% + 1: IF x% = XEnd THEN GOSUB NextScanLine
NEXT a%
IF NextCode < 4096 THEN
Prefix(NextCode) = LastCode
Suffix(NextCode) = LastPixel
NextCode = NextCode + 1
IF NextCode > MaxCode AND CodeSize < 12 THEN
CodeSize = CodeSize + 1
MaxCode = MaxCode * 2 + 1
END IF
END IF
LastCode = Code
END IF
END IF
LOOP UNTIL DoneFlag OR Code = EOSCode
'BEEP
'A$ = INPUT$(1)
EXIT SUB
GetByte: a$ = " ": GET #1, , a$: a% = ASC(a$): RETURN
NextScanLine:
IF Interlaced THEN
y% = y% + PassStep
IF y% >= YEnd THEN
PassNumber = PassNumber + 1
SELECT CASE PassNumber
CASE 1: y% = 4: PassStep = 8
CASE 2: y% = 2: PassStep = 4
CASE 3: y% = 1: PassStep = 2
END SELECT
END IF
ELSE
y% = y% + 1
END IF
x% = XStart: Ybase = y% * 320&: DoneFlag = y% > 199
RETURN
GetCode:
IF BitsIn = 0 THEN GOSUB ReadBufferedByte: LastChar = a%: BitsIn = 8
WorkCode = LastChar \ shiftout%(BitsIn)
DO WHILE CodeSize > BitsIn
GOSUB ReadBufferedByte: LastChar = a%
WorkCode = WorkCode OR LastChar * powersof2(BitsIn)
BitsIn = BitsIn + 8
LOOP
BitsIn = BitsIn - CodeSize
Code = WorkCode AND MaxCode
RETURN
ReadBufferedByte:
IF BlockPointer > BlockSize THEN
GOSUB GetByte: BlockSize = a%
a$ = SPACE$(BlockSize): GET #1, , a$
BlockPointer = 1
END IF
a% = ASC(MID$(a$, BlockPointer, 1)): BlockPointer = BlockPointer + 1
RETURN
END SUB
[ add comment ] | permalink |




( 0 / 0 )Berikut ini adalah review dari game Quest of Rosetta saya yang sangaaat sederhana… Kita mulai saja deh…
Untuk menjalankan game ini, saya mendistribusikan dalam bentuk source code, jadi dibutuhkan program compiler QuickBasic versi 4.5, atau file QBasic.exe dari MSDOS. Sedangkan program Turbo Basic atau Power Basic buatan Borland, tidak compatible dengan perintah-perintah di dalam program game ini.
Cara mainnya sebenarnya gampang (baca:simpel) kok. Hanya perlu kontrol dari tombol arrow key untuk menggerakkan Rosetta, trus tombol ENTER untuk memilih pilihan. Memang banyak ngomongnya, karena itu saya bilang game ini agak monoton, dan maaf kalau anda mengharapkan pukul2an, sikut2an sampai jambak2an, anda akan kecewa karena tidak akan anda temui disini. Trus mengenai ada gambar jin kura2, ya pengen gambar aja kayak gitu, boleh kan? :)
Gambar spritenya memang jelek, karena buatnya gampang2an saja. Itu pun saya buat dengan program sprite editor. Sebenarnya ada rencana untuk buat yang lebih bagus pakai VB atau Flash, tapi masih belum sempat.
Mengenai Format gambar menggunakan BSAVEnya QBasic. Kalau diperhatikan, isi filenya adalah sekumpulan bilangan integer alias bilangan bulat.
Cara mendeteksi tubrukan antar sprite saya pakai cara pendeteksi yang paling gampang saja. Jadi begini, untuk tiap scene, saya beri nomor, lalu saya beri pengecekan untuk tiap langkah Rosetta, misalnya untuk langkah atas, ini adalah subrutin untuk menjalankan Rosetta apabila tombol panah atas ditekan.
SELECT CASE c
CASE 1
IF mu = 0 THEN PUT (x.old, y.old), spru1 ELSE PUT (x.old, y.old), spru2
CASE 2
IF ml = 0 THEN PUT (x.old, y.old), sprl1 ELSE PUT (x.old, y.old), sprl2
CASE 3
IF mr = 0 THEN PUT (x.old, y.old), sprr1 ELSE PUT (x.old, y.old), sprr2
CASE 4
IF md = 0 THEN PUT (x.old, y.old), sprd1 ELSE PUT (x.old, y.old), sprd2
END SELECT
Pertama2 kita cek, posisi sprite Rosetta. sprite Rosetta digambarkan dengan dua sprite yang bergantian setiap dijalankan sehingga kelihatan dinamis walaupun tetap aja kaku. Nah perintah diatas akan mengecek posisi sprite Rosetta, apakah menghadap atas, kiri, kanan atau bawah. Variabel mu, ml, mr dan md digunakan untuk mengecek jenis sprite yang mana yang aktif pada saat itu, baru kemudian dilakukan penghapusan terhadap sprite. Asal tahu saja, kalau salah menentukan sprite yang dihapus, animasinya bisa berantakan… Trus kalau dihapus, kita akan gambar lagi spritenya di lokasi yang baru, tapi sebelumnya kita perlu cek lagi posisi Rosetta ada di scene keberapa? Kita cek dengan perintah SELECT CASE
SELECT CASE cek
CASE 0
y.bawah = y.atas
CASE 1
IF x.pos <= 170 OR x.pos >= 230 THEN y.bawah = y.atas
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN Camiria: GOSUB Initsprite:
GOTO main
CASE 2, 3, 4, 14
y.bawah = y.atas
CASE 5
IF x.pos <= 170 OR x.pos >= 230 THEN y.bawah = y.atas
CASE 6, 8, 15, 17, 18, 19, 22, 23, 24
y.atas = y.atas + 20
y.bawah = y.atas
CASE 7, 9, 28, 29
IF x.pos <= 170 OR x.pos >= 230 THEN y.atas = y.atas + 20: y.bawah = y.atas
CASE 10
y.bawah = y.atas
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN HouseNol: GOSUB Initsprite:
GOTO main
CASE 11, 20, 25, 33, 34
IF x.pos <= 170 OR x.pos >= 230 THEN y.atas = y.atas + 20: y.bawah = y.atas
CASE 13
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN Tyverra: GOSUB Initsprite:
GOTO main
y.bawah = y.atas
CASE 21
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN HouseOne: GOSUB Initsprite:
GOTO main
IF x.pos <= 170 OR x.pos >= 230 THEN y.bawah = y.atas
CASE 31
y.bawah = y.atas
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN Winkle: GOSUB Initsprite:
GOTO main
CASE 37
y.bawah = y.atas
IF (x.pos >= 160 AND y.pos >= 50) AND (x.pos <= 180 AND y.pos <= 70) THEN HouseTwo: GOSUB Initsprite:
GOTO main
END SELECT
Perintah diatas akan mengecek posisi batas (ingat yang kita perhatikan disini adalah penekanan tombol atas). Variabel y.atas akan berisi suatu nilai yang menunjukkan batas atas dari gerakan Rosetta. Kalau kita perhatikan, dalam beberapa scene, variabel ini ditambah 20. Artinya di dalam scene tersebut, Rosetta lebih dibatasi geraknya. Pada posisi tertentu, saya menggunakan operator AND untuk membuat kotak bayangan, dimana apabila posisi Rosetta di dalam kotak tersebut, maka program akan memanggil sub yang lain, dalam hal ini kita misalkan Rosetta masuk ke dalam kota tertentu. Gampang dan sederhana khan? Jika muncul pertanyaan… kenapa pada semua CASE, variabel y.bawah diset sama dengan y.atas??? Nah, ini salah satu trik supaya sprite Rosetta tidak hancur pada saat dia menabrak batas pohon atau karang. Pada akhir subrutin, sebelum return ke program utama, nilai variabel y.bawah akan dikembalikan ke nilai aslinya.
IF mu = 0 THEN
IF y.pos <= y.atas THEN
IF cek = 1 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 0: GOSUB sc0
IF cek = 5 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 2: GOSUB sc2
IF cek = 7 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 4: GOSUB sc4
IF cek = 9 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 10: GOSUB sc10
IF cek = 12 THEN cek = 13: GOSUB sc13
IF cek = 11 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 12: GOSUB sc12
IF cek = 16 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 6: GOSUB sc6
IF cek = 20 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 11: GOSUB sc11
IF cek = 21 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 16: GOSUB sc16
IF cek = 25 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 20: GOSUB sc11
IF cek = 26 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 15: GOSUB sc15
IF cek = 27 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 26: GOSUB sc16
IF cek = 28 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 27: GOSUB sc16
IF cek = 30 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 31: GOSUB sc31
IF cek = 29 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 30: GOSUB sc16
IF cek = 32 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 28: GOSUB sc28
IF cek = 36 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 37: GOSUB sc10
IF cek = 35 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 36: GOSUB sc35
IF cek = 34 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 35: GOSUB sc35
IF cek = 33 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 34: GOSUB sc34
y.pos = y.bawah
ELSE
y.pos = y.pos - y.ofset
END IF
PUT (x.pos, y.pos), spru2
x.old = x.pos: y.old = y.pos
mu = 1
ELSE
IF y.pos <= y.atas THEN
IF cek = 1 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 0: GOSUB sc0
IF cek = 5 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 2: GOSUB sc2
IF cek = 7 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 4: GOSUB sc4
IF cek = 9 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 10: GOSUB sc10
IF cek = 12 THEN cek = 13: GOSUB sc13
IF cek = 11 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 12: GOSUB sc12
IF cek = 16 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 6: GOSUB sc6
IF cek = 20 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 11: GOSUB sc11
IF cek = 21 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 16: GOSUB sc16
IF cek = 25 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 20: GOSUB sc11
IF cek = 26 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 15: GOSUB sc15
IF cek = 27 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 26: GOSUB sc16
IF cek = 28 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 27: GOSUB sc16
IF cek = 30 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 31: GOSUB sc31
IF cek = 29 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 30: GOSUB sc16
IF cek = 32 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 28: GOSUB sc28
IF cek = 36 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 37: GOSUB sc10
IF cek = 35 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 36: GOSUB sc35
IF cek = 34 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 35: GOSUB sc35
IF cek = 33 THEN IF x.pos > 170 AND x.pos < 230 THEN cek = 34: GOSUB sc34
y.pos = y.bawah
ELSE
y.pos = y.pos - y.ofset
END IF
PUT (x.pos, y.pos), spru1
x.old = x.pos: y.old = y.pos
mu = 0
END IF
y.atas = batas1
x.kiri = batas2
x.kanan = batas3
y.bawah = batas4
RETURN
Waw, panjaaang banget… tapi belum seberapa dibanding sisanya. Kalau sudah paham sama sub rutin tombol atas, yang lainnya pasti paham dengan sendirinya. Bagian yang ini akan mengecek posisi sprite Rosetta. Apabila sudah kurang dari y.atas, maka saatnya Rosetta pindah scene dari satu scene ke scene lainnya. Variabel cek digunakan untuk mengecek scene. Variabel y.pos diset sama dengan y.bawah, dan karena tadi variabel y.bawah = y.atas, maka sprite Rosetta akan tetap diam di tempatnya. Lalu kita sampai pada perintah ELSE, yang artinya jika y.pos>y.atas. Nah disinilah, sprite Rosetta digambar lagi. Tentunya mesti hati2, jangan sampai kita memberikan sprite yang salah, soalnya gerakan Rosetta bisa lucu. Dan sebelum kembali ke looping utama, variabel2 batas dikembalikan seperti semula.
Untuk mendapatkan uang gampang kok. Kita harus sabar mondar-mandir di dua kota untuk kerja ngantar jerami buat kuda. Terus bisa juga gambling di danau keberuntungan.
Semua barang harus didapatkan karena ada kegunaannya sendiri2.Yg jelas, cerita berakhir kalau semua barang sudah didapatkan.
Jika ada keinginan untuk memodifikasi game ini (jangan lupa untuk mengontak saya ya?), yang terpenting adalah menambahkan unsur arcade. Misalnya Rosetta akan mempunyai LifeMeter dan harus melawan musuh2nya sebelum melawan musuh terakhirnya. Kalau di dalam perjalanannya LifeMeternya habis, maka GameOver… Bisa juga barang2nya ditambah dengan Minuman Tonic untuk menambah Life, misalnya. Kalau mau, boleh dibesarkan dunianya, biar tidak monoton. Gambar spritenya dapat juga dimodifikasi agar lebih baik lagi.
Pada versi sekuelnya yang belum sempat saya selesaikan, saya berhasil membuat scene-nya full layar, melihat inventorynya dengan teknik page dan savescreen, pendeteksian tubrukannya saya bikin lebih akurat dengan metode pembandingan warna, sehingga gerakan sprite tidak terbatas dan kaku, dan juga menghemat pemakaian memori, dan juga font yang digunakan bukan berupa sprite lagi. Disamping itu, saya dapat menganimasikan sprite lainnya pada saat Rosetta berjalan, ini yang membuat game menjadi tidak kaku.
Yah… semuanya kembali lagi pada keterbatasan program QuickBasic setelah pada jaman sekarang muncul program2 lain yang lebih canggih seperti VisualBasic dan Flash. Tapi bagi saya, kita tidak boleh meremehkan program2 lama. Apa yang saya dapatkan pada saat saya mempelajari teknik2 animasi, sekalipun dari program lama, saya yakin akan dapat pula saya terapkan pada program2 sekarang. So, mari kita terus belajar dan belajarrr… Setuju???
[ add comment ] ( 46 views ) | permalink |




( 0 / 0 )Sampai disini kita baru menggunakan satu buah scene yang diambil dengan BLOAD, tapi dengan single scene tersebut, Marle bebas bergerak kemana saja dan akan berhenti kalau membentur pohon. Berikut programnya…
’Marle with Collission Detection using POINT
‘Addition: Check Border Screen Collission
‘ Loading Map using BLOAD from BSAVE File
CLEAR
DEFINT A-Z
CONST Path$ = “”
OPEN “tree.shp” FOR INPUT AS #1
DIM SHARED tree(222): FOR i = 0 TO 222: INPUT #1, tree(i): NEXT: CLOSE #1
‘Kumpulan Gambar Marle bergerak ke kanan
‘15 x 32
OPEN Path$ + “Marler.shp” FOR INPUT AS #1
DIM SHARED marler(266): FOR i = 0 TO 266: INPUT #1, marler(i): NEXT: CLOSE #1
‘17 x 32
OPEN Path$ + “Marler1.shp” FOR INPUT AS #1
DIM SHARED marler1(299): FOR i = 0 TO 299: INPUT #1, marler1(i): NEXT: CLOSE #1
‘18 x 30
OPEN Path$ + “Marler2.shp” FOR INPUT AS #1
DIM SHARED marler2(296): FOR i = 0 TO 296: INPUT #1, marler2(i): NEXT: CLOSE #1
‘18 x 32
OPEN Path$ + “Marler3.shp” FOR INPUT AS #1
DIM SHARED marler3(315): FOR i = 0 TO 315: INPUT #1, marler3(i): NEXT: CLOSE #1
‘17 x 32
OPEN Path$ + “Marler4.shp” FOR INPUT AS #1
DIM SHARED marler4(299): FOR i = 0 TO 299: INPUT #1, marler4(i): NEXT: CLOSE #1
‘18 x 31
OPEN Path$ + “Marler5.shp” FOR INPUT AS #1
DIM SHARED marler5(306): FOR i = 0 TO 306: INPUT #1, marler5(i): NEXT: CLOSE #1
‘19 x 32
OPEN Path$ + “Marler6.shp” FOR INPUT AS #1
DIM SHARED marler6(332): FOR i = 0 TO 332: INPUT #1, marler6(i): NEXT: CLOSE #1
‘Kumpulan Gambar Marle bergerak ke kiri
‘15 x 32
OPEN Path$ + “Marlel.shp” FOR INPUT AS #1
DIM SHARED marlel(266): FOR i = 0 TO 266: INPUT #1, marlel(i): NEXT: CLOSE #1
‘17 x 32
OPEN Path$ + “Marlel1.shp” FOR INPUT AS #1
DIM SHARED marlel1(299): FOR i = 0 TO 299: INPUT #1, marlel1(i): NEXT: CLOSE #1
‘18 x 30
OPEN Path$ + “Marlel2.shp” FOR INPUT AS #1
DIM SHARED marlel2(296): FOR i = 0 TO 296: INPUT #1, marlel2(i): NEXT: CLOSE #1
‘18 x 32
OPEN Path$ + “Marlel3.shp” FOR INPUT AS #1
DIM SHARED marlel3(315): FOR i = 0 TO 315: INPUT #1, marlel3(i): NEXT: CLOSE #1
‘17 x 32
OPEN Path$ + “Marlel4.shp” FOR INPUT AS #1
DIM SHARED marlel4(299): FOR i = 0 TO 299: INPUT #1, marlel4(i): NEXT: CLOSE #1
‘18 x 31
OPEN Path$ + “Marlel5.shp” FOR INPUT AS #1
DIM SHARED marlel5(306): FOR i = 0 TO 306: INPUT #1, marlel5(i): NEXT: CLOSE #1
‘19 x 32
OPEN Path$ + “Marlel6.shp” FOR INPUT AS #1
DIM SHARED marlel6(332): FOR i = 0 TO 332: INPUT #1, marlel6(i): NEXT: CLOSE #1
‘Kumpulan Gambar Marle bergerak ke bawah
‘13 x 33
OPEN Path$ + “Marled.shp” FOR INPUT AS #1
DIM SHARED marled(240): FOR i = 0 TO 240: INPUT #1, marled(i): NEXT: CLOSE #1
‘14 x 33
OPEN Path$ + “Marled1.shp” FOR INPUT AS #1
DIM SHARED marled1(257): FOR i = 0 TO 257: INPUT #1, marled1(i): NEXT: CLOSE #1
‘15 x 35
OPEN Path$ + “Marled2.shp” FOR INPUT AS #1
DIM SHARED marled2(290): FOR i = 0 TO 290: INPUT #1, marled2(i): NEXT: CLOSE #1
‘15 x 35
OPEN Path$ + “Marled3.shp” FOR INPUT AS #1
DIM SHARED marled3(290): FOR i = 0 TO 290: INPUT #1, marled3(i): NEXT: CLOSE #1
‘14 x 35
OPEN Path$ + “Marled4.shp” FOR INPUT AS #1
DIM SHARED marled4(257): FOR i = 0 TO 257: INPUT #1, marled4(i): NEXT: CLOSE #1
‘16 x 35
OPEN Path$ + “Marled5.shp” FOR INPUT AS #1
DIM SHARED marled5(308): FOR i = 0 TO 308: INPUT #1, marled5(i): NEXT: CLOSE #1
‘15 x 35
OPEN Path$ + “Marled6.shp” FOR INPUT AS #1
DIM SHARED marled6(290): FOR i = 0 TO 290: INPUT #1, marled6(i): NEXT: CLOSE #1
‘Kumpulan Gambar Marle bergerak ke atas
‘12 x 32
OPEN Path$ + “Marleu.shp” FOR INPUT AS #1
DIM SHARED marleu(216): FOR i = 0 TO 216: INPUT #1, marleu(i): NEXT: CLOSE #1
‘13 x 32
OPEN Path$ + “Marleu1.shp” FOR INPUT AS #1
DIM SHARED marleu1(233): FOR i = 0 TO 233: INPUT #1, marleu1(i): NEXT: CLOSE #1
‘16 x 33
OPEN Path$ + “Marleu2.shp” FOR INPUT AS #1
DIM SHARED marleu2(291): FOR i = 0 TO 291: INPUT #1, marleu2(i): NEXT: CLOSE #1
‘14 x 33
OPEN Path$ + “Marleu3.shp” FOR INPUT AS #1
DIM SHARED marleu3(257): FOR i = 0 TO 257: INPUT #1, marleu3(i): NEXT: CLOSE #1
‘13 x 32
OPEN Path$ + “Marleu4.shp” FOR INPUT AS #1
DIM SHARED marleu4(233): FOR i = 0 TO 233: INPUT #1, marleu4(i): NEXT: CLOSE #1
‘16 x 33
OPEN Path$ + “Marleu5.shp” FOR INPUT AS #1
DIM SHARED marleu5(291): FOR i = 0 TO 291: INPUT #1, marleu5(i): NEXT: CLOSE #1
‘14 x 33
OPEN Path$ + “Marleu6.shp” FOR INPUT AS #1
DIM SHARED marleu6(257): FOR i = 0 TO 257: INPUT #1, marleu6(i): NEXT: CLOSE #1
PRINT “Free array space : “; FRE(-1)
t$ = INPUT$(1)
SCREEN 13
CLS
‘Animasi berjalan
x.pos = 10: y.pos = 30
x.old = x.pos: y.old = y.pos
x.ofset = 4: y.ofset = 4
‘variabel posisi digunakan untuk mengecek posisi terakhir sprite
posisi = 1
‘variabel waktu tunda untuk animasi Marle berjalan
delay = 1700
bataskanan = 295
bataskiri = 10
batasbawah = 160
batasatas = 10
cek.selisih = 5
center.selisih = 5
GOSUB Scene1
PUT (x.pos, y.pos), marler
main:
x.center = x.pos + 10
y.center = y.pos + 15
a$ = INKEY$
IF a$ = “” THEN GOTO main
IF LEN(a$) <> 2 THEN GOSUB not.arrow
keyb = ASC(RIGHT$(a$, 1))
IF keyb = 72 THEN GOSUB atas
IF keyb = 75 THEN GOSUB kiri
IF keyb = 77 THEN GOSUB kanan
IF keyb = 80 THEN GOSUB bawah
‘clean the keyboard buffer before go back to main loop
DEF SEG = &H40
POKE &H1A, PEEK(&H1C)
GOTO main
kanan:
‘hapus spritenya
‘cek posisi terakhir sprite menghadap kemana???
oldx.pos = x.pos: oldy.pos = y.pos
SELECT CASE posisi
CASE 1 ‘kanan
PUT (oldx.pos, oldy.pos), marler
CASE 2 ‘kiri
PUT (oldx.pos, oldy.pos), marlel
CASE 3 ‘bawah
PUT (oldx.pos, oldy.pos), marled
CASE 4 ‘atas
PUT (oldx.pos, oldy.pos), marleu
END SELECT
IF POINT((marler1(0) / 8) + x.pos + cek.selisih, y.pos) <= 0 AND POINT((marler1(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler1(0) / 8) + x.pos + cek.selisih, marler1(1) + y.pos) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler1
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler1
IF POINT((marler2(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler2(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler2(0) / 8) + x.pos + cek.selisih, marler2(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler2
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler2
IF POINT((marler3(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler3(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler3(0) / 8) + x.pos + cek.selisih, marler3(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler3
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler3
IF POINT((marler4(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler4(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler4(0) / 8) + x.pos + cek.selisih, marler4(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler4
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler4
IF POINT((marler5(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler5(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler5(0) / 8) + x.pos + cek.selisih, marler5(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler5
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler5
IF POINT((marler6(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler6(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler6(0) / 8) + x.pos + cek.selisih, marler6(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler6
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marler6
IF POINT((marler(0) / 8) + x.pos + cek.selisih, y.pos + center.selisih) <= 0 AND POINT((marler(0) / 8) + x.pos + cek.selisih, y.center) <= 0 AND POINT((marler(0) / 8) + x.pos + cek.selisih, marler(1) + y.pos - center.selisih) <= 0 THEN
IF x.pos <= bataskanan THEN
x.pos = x.pos + x.ofset
ELSE
x.pos = bataskiri
END IF
ELSE
PUT (x.pos, y.pos), marler
posisi = 1
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marler
'jangan lupa untuk mengeset variabel posisi
posisi = 1
RETURN
kiri:
'hapus spritenya
'cek posisi terakhir sprite menghadap kemana???
oldx.pos = x.pos: oldy.pos = y.pos
SELECT CASE posisi
CASE 1 'kanan
PUT (oldx.pos, oldy.pos), marler
CASE 2 'kiri
PUT (oldx.pos, oldy.pos), marlel
CASE 3 'bawah
PUT (oldx.pos, oldy.pos), marled
CASE 4 'atas
PUT (oldx.pos, oldy.pos), marleu
END SELECT
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel1(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel1
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel1
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel2(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel2
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel2
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel3(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel3
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel3
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel4(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel4
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel4
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel5(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel5
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel5
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel6(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel6
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marlel6
IF POINT(x.pos - cek.selisih, y.pos) <= 0 AND POINT(x.pos - cek.selisih, y.center) <= 0 AND POINT(x.pos - cek.selisih, marlel(1) + y.pos) <= 0 THEN
IF x.pos >= bataskiri THEN
x.pos = x.pos - x.ofset
ELSE
x.pos = bataskanan
END IF
ELSE
PUT (x.pos, y.pos), marlel
posisi = 2
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marlel
‘jangan lupa untuk mengeset variabel posisi
posisi = 2
RETURN
bawah:
‘hapus spritenya
‘cek posisi terakhir sprite menghadap kemana???
oldx.pos = x.pos: oldy.pos = y.pos
SELECT CASE posisi
CASE 1 ‘kanan
PUT (oldx.pos, oldy.pos), marler
CASE 2 ‘kiri
PUT (oldx.pos, oldy.pos), marlel
CASE 3 ‘bawah
PUT (oldx.pos, oldy.pos), marled
CASE 4 ‘atas
PUT (oldx.pos, oldy.pos), marleu
END SELECT
IF POINT(x.pos, marled1(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled1(1) + y.pos + cek.selisih) <= 0 AND POINT((marled1(0) / 8) + x.pos, marled1(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled1
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled1
IF POINT(x.pos, marled2(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled2(1) + y.pos + cek.selisih) <= 0 AND POINT((marled2(0) / 8) + x.pos, marled2(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled2
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled2
IF POINT(x.pos, marled3(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled3(1) + y.pos + cek.selisih) <= 0 AND POINT((marled3(0) / 8) + x.pos, marled3(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled3
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled3
IF POINT(x.pos, marled4(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled4(1) + y.pos + cek.selisih) <= 0 AND POINT((marled4(0) / 8) + x.pos, marled4(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled4
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled4
IF POINT(x.pos, marled5(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled5(1) + y.pos + cek.selisih) <= 0 AND POINT((marled5(0) / 8) + x.pos, marled5(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled5
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled5
IF POINT(x.pos, marled6(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled6(1) + y.pos + cek.selisih) <= 0 AND POINT((marled6(0) / 8) + x.pos, marled6(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled6
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
'hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marled6
IF POINT(x.pos, marled(1) + y.pos + cek.selisih) <= 0 AND POINT(x.center, marled(1) + y.pos + cek.selisih) <= 0 AND POINT((marled(0) / 8) + x.pos, marled(1) + y.pos + cek.selisih) <= 0 THEN
IF y.pos <= batasbawah THEN
y.pos = y.pos + y.ofset
ELSE
y.pos = batasatas
END IF
ELSE
PUT (x.pos, y.pos), marled
posisi = 3
RETURN
END IF
'letakkan di posisi baru
PUT (x.pos, y.pos), marled
'jangan lupa untuk mengeset variabel posisi
posisi = 3
RETURN
atas:
'hapus spritenya
'cek posisi terakhir sprite menghadap kemana???
oldx.pos = x.pos: oldy.pos = y.pos
SELECT CASE posisi
CASE 1 'kanan
PUT (oldx.pos, oldy.pos), marler
CASE 2 'kiri
PUT (oldx.pos, oldy.pos), marlel
CASE 3 'bawah
PUT (oldx.pos, oldy.pos), marled
CASE 4 'atas
PUT (oldx.pos, oldy.pos), marleu
END SELECT
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu1(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu1
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu1
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu2(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu2
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu2
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu3(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu3
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu3
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu4(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu4
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu4
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu5(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu5
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu5
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu6(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu6
FOR z = 1 TO delay: FOR y = 1 TO delay: NEXT: NEXT
‘hapus spritenya
oldx.pos = x.pos: oldy.pos = y.pos
PUT (oldx.pos, oldy.pos), marleu6
IF POINT(x.pos, y.pos - cek.selisih) <= 0 AND POINT(x.center, y.pos - cek.selisih) <= 0 AND POINT((marleu(0) / 8) + x.pos, y.pos - cek.selisih) <= 0 THEN
IF y.pos >= batasatas THEN
y.pos = y.pos - y.ofset
ELSE
y.pos = batasbawah
END IF
ELSE
PUT (x.pos, y.pos), marleu
posisi = 4
RETURN
END IF
‘letakkan di posisi baru
PUT (x.pos, y.pos), marleu
‘jangan lupa untuk mengeset variabel posisi
posisi = 4
RETURN
Scene1:
DEF SEG = &HA000
BLOAD “Screen1.Map”
DEF SEG
RETURN
not.arrow:
‘Jika ditekan tombol q maka program akan berhenti
IF a$ = “q” THEN
WIDTH 80
SCREEN 0
COLOR 7, 0
CLS
END
END IF
RETURN
Yang memegang peranan penting selain gambar map, adalah cerita dari game itu sendiri. Unsur cerita ini terkadang suka diabaikan sehingga terkesan kaku dan karakter yang ada di game itu juga kurang mempunyai “jiwa”. Ternyata membuat game juga melibatkan perasaan yah… Seperti dalam game saya Quest of Rosetta, mungkin gampang ditebak endingnya yah…
[ add comment ] ( 55 views ) | permalink |




( 0 / 0 )
Calendar



