menerapkan operasi aritmetika pada variable

Posted by abdul azis On Kamis, 28 April 2011 21 komentar

Operasi Aritmetika untuk Variable
Pada pembahasan sebelumnya, kita telah mengenal dasar-dasar serta fungsi dari variable dalam pembuatan game. Pada pembahasan kali ini, kita akan mempelajari mengenai bagaimana cara memanipulasi nilai-nilai dari sebuah variable dengan menggunakan operasi Aritmetika.
Cara menambah nilai variable
Seperti yang telah kita ketahui, bahwa bila kita membuat variable seperti dibawah ini :
score = 0
Maka, artinya bahwa kita telah membuat sebuah variable yang bernama score dan men-setting nilainya sama dengan (nol).

Nah, sekarang pertanyaannya bagaimana cara agar kita bisa menambah nilai dari variable score tersebut?
Untuk menambah nilai dari suatu variable kita bisa menggunakan operasi tambah ( + ).

Bentuk Umum dari Operasi pertambahan adalah :
- - - - - - - - - - -
variable +=nilai
- - - - - - - - - - -
Contoh :
score +=100
Artinya : kita menambah nilai dari variable score sebesar 100 ( Seratus).
Sehingga dengan menambahkan script ini, variable score yang asalnya mempunyai nilai sama dengan 0 (nol), menjadi bertambah sebesar 100 (seratus).

Cara mengurangi nilai variable
Caranya hampir sama seperti cara diatas, hanya saja kali ini kita menggunakan operasi pengurangan ( - )

Bentuk Umum dari Operasi pengurangan adalah :
- - - - - - - - - - -
variable -=nilai
- - - - - - - - - - -
Contoh :
score -=50
Artinya : kita mengurangi nilai dari variable score sebesar 50 ( Lima puluh).
Sehingga dengan menambahkan script ini, variable score yang asalnya mempunyai nilai sama dengan 0 (nol), menjadi berkurang sebesar 50 (Lima puluh).

Operasi Perkalian dan Pembagian untuk variable
Caranya juga sama seperti cara diatas, hanya saja untuk perkalian rumusnya adalah :

Bentuk Umum dari Operasi perkalian adalah :
- - - - - - - - - - -
variable *=nilai
- - - - - - - - - - -

Sedangkan, Bentuk Umum dari Operasi pembagian adalah :
- - - - - - - - - - -
variable /=nilai
- - - - - - - - - - -

21 komentar:

risnadi mengatakan...

tolong om abdul azis...
jangan pernah berhenti posting tutorial... >,<
aku suka bgt sama tutorial dari om abdul azis >,<

Anonim mengatakan...

Wah.,ada lanjutannya g mas.,.lagi kecanduan ne bikin game nya,..
salam kenal

Anonim mengatakan...

bagus ni tutorialnya, klo bisa om tutorial membuat game 3d di game maker pliss.

Anonim mengatakan...

bagus bang, abang ada semua tutorial yang dijadiin 1 ngk bang? jadi 1 file pdf

Anonim mengatakan...

om aku mw tanya
gimana membuat roda berputar
atau bola ber putar

gimana membuat file .png bisa ber gerak
seperti orang ber jalan
mohon pencerahannya om...


Anonim mengatakan...

thanks banget ya utk tutornya!!! q jadi bisa buat game q sendiri! terus semangat ya mas/ om/ pak/ mbah!!!!

Unknown mengatakan...

kerreeeeennnnnn..... kebetulan ney baru mo mulai bikin game..... jgn pernah bosen posting ya mas...!!!!

Mardi Adam mengatakan...

Mardi Adam mengatakan...

Mas... bisa kirim tutorial lengkap ...mulai dr nol sampe jd tuk game jenis mail ini.. sy mau coba ni... bisa kan.....?

Kamal Fadli mengatakan...

tolong post tutorial game 3D...coz, saya mau and pengen nyaingin Rohan Online ( ngarep) :D

Anonim mengatakan...


Anonim mengatakan...

maker nya cacad gx ngerti aku

Anonim mengatakan...

kerreeeeennnnnn..... kebetulan ney baru mo mulai bikin game.....bosen posting ya mas...!!!!

panji satrio mengatakan...

Om cara membuat NPC peke script apakah benar hanya menentukan koordinat and event aja?
Kebanyakan GM memakai Reserved word buat NPC
Apa ada cara lain?

muhammad ridwan mengatakan...

mas saya kok bikin event keyboad press up trus set gravity yg atas -90 tus gravitynya 2 trus create event set ve.speed 0 lalu collison ma stone non effent pk event ver.speed waktu saya jalanin kok lompatnya terus2an ya???(gak mau berhenti)

payzo mengatakan...

terima kasih.. semuanya sudah saya baca...
memang masih kurang dari yang dinginkan.. tunggu hasil game yang sedang ta rancang...

Anonim mengatakan...

Heya i'm for the primary time here. I found this board and I find It truly useful & it helped
me out much. I am hoping to give one thing back and help
others such as you helped me.

Here is my website - buy viagra online

Anonim mengatakan...

Hurrah! At last I got a web site from where I be able to actually get valuable facts regarding my
study and knowledge.

Here is my website; Erotic massage london -,

Anonim mengatakan...

ane ngerti sekarang

Anonim mengatakan...

This random number generator can be a lotto player's
reliable tool in selecting numbers that have high chances of winning within the lottery.

Almost all Advance Wars games have a lighter tone, but Days of Ruin replaces cartoony visuals and humorous dialogues using a rather morbid
tone and new visuals. ' Memory: Real time strategy game online generally has different
elements and aspects to take into consideration that needed to be unfolded.

In Asia, there can be possibly 12 million players who may be engaged
within the game at peak times. Well the greatest difference is the action title, it is exactly what the action is information on so when the truth is your
1st Rift open right in front for you, it just blows you away.
This is excellent information for brand spanking new players who're
unclear about how the overall game is balanced. Most online games are free, supported mostly
by ads, though some games charge users for premium
features. Players own and operate their particular eatery, furnish it with stoves, tables and
chairs and open their doors to hungry customers.
br'>Jogos Online, or just Jogos, offer games which might be completely free to experience which will never change.
Some players believe that its luck causing them to be loose or win,
but also in real, its the ability and skill of the player who plays web marketing strategy
games which makes him loose or win the action. This ensures that they can play the online strategy games without getting tired.
First you produce a special team like an army then you get on a ship much like they did in era of yore then you defeat your enemies when you plan to control the complete
civilization. Without any doubt, these games are certain to get
you thinking and make you entertained. The batter will
most likely swing extraordinary from the ball or will
be exit right in front from the pitch. There are as much as 4 different gaming options for example board
game, quick game, time attack and challenge modes as well
as the opportunity to discover and build on 5 Manhattan districts.
There are plenty of special skills to decide on from along with
a massive amount ship customization options, allowing one to decide about the right armament
to your ships. It is a method employed in practice situations to imitate actual cigarettes
and hone your performance. You also can play solo and sharpen your abilities before going
on the web and compete against others. There are wide
ranging kinds of i - Phone Applications that make your phone an enhanced supply
of information, applications that are designed accordingly for a needs and will offer
suitable solutions towards the services you ever desired for.
You will be encountered with a certain level of physical deterioration similar to an actual match.

They discovered a large percentage of older gamers
- just under 53% - of them were women. Create a select band of friends and rehearse the broadband server to host
a private gaming server. Use a multisensory approach every time you rehearse:
say it, write it, read it, draw it, sing it.
You can start to play action, adventure, first person shooter, puzzle, role playing, as well as other types of cool games.
Most games incorporate some technique of some sort, however, those classified as strategy
games tend exact the decision making skills of the
player to find out more than half from the final scores.

My site - summoners war sky arena cheat

Dewa Poker Online mengatakan...

Terima Kasih atas informasinya min..

Posting Komentar

Silahkan masukan e-mail Anda pada kotak subscribe lewat e-mail untuk segera mengetahui jawaban dari saran-saran serta pertanyaan yang Anda ajukan!

terima kasih....,