Prodig - Komunitas Proyek Digital
Selamat datang di ProDig!
Di sini adalah tempat untuk berbagi proyek (game, seni, program, dan situs).
Di sini Anda juga bisa mendapatkan hal lainnya seperti permainan, berbagi karya, ilmu pengetahuan, kesenangan, dan sebagainya. :)

Ayo daftar lalu langsung login tanpa perlu konfirmasi email sama sekali :D!
Prodig - Komunitas Proyek Digital

Tempat untuk berbagi proyek digital : Situs, Game, Seni, Program
 
CalendarPortalHomeRulesSearchFAQMemberlistUsergroupsRegisterLog in
Welcome to the ProDig, Guest!

 
 

 [GM]nanya cara bikin karakter gerak

View previous topic View next topic Go down 
AuthorMessage
r15n4d1
Decem


Status : pengen belajar script GML
Posts : 15
Chips : 2273
Power : 0
Join date : 2010-12-16
Age : 22
Location : pulau antah berantah

PostSubject: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:32 pm


kk prodig!
khusuny pengguna gm!
ane mo nanya nih, gimana cara membuat
karakter bisa jalan keatas, kebawah, kekiri, dan kekanan.
dan create event, ama step event itu gunany buat apa y?

sori, i;m just newbie!



Back to top Go down
View user profile http://artikelrame.blogspot.com
Vsio
Centum


Posts : 205
Chips : 2860
Power : 1
Join date : 2011-03-04
Location : Between Existence and Anti-Existence
Quote : As long I exist, I shall influence the flow of existence.

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:41 pm


Caranya,

event Step:

Code:
kecepatan = 10; // kecepatan bergerak sebesar 10 pixel
if keyboard_check(vk_up) {y -= kecepatan;} // atas
if keyboard_check(vk_down) {y += kecepatan;} // bawah
if keyboard_check(vk_left) {x -= kecepatan;} // kiri
if keyboard_check(vk_right) {x += kecepatan;} // kanan

Create event:
Eksekusi suatu kode yang hanya terjadi ketika suatu instansi disiptakan
Contoh: Aksi settingan HP dan MP

Step event:
Eksekusi suatu kode yang terjadi tiap waktu
Contoh: Aksi bergerak



Back to top Go down
View user profile http://www.stitched.netai.net
r15n4d1
Decem


Status : pengen belajar script GML
Posts : 15
Chips : 2273
Power : 0
Join date : 2010-12-16
Age : 22
Location : pulau antah berantah

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:48 pm


oh iya.. satu lagi
apa bedany step sama begin step?



Back to top Go down
View user profile http://artikelrame.blogspot.com
Vsio
Centum


Posts : 205
Chips : 2860
Power : 1
Join date : 2011-03-04
Location : Between Existence and Anti-Existence
Quote : As long I exist, I shall influence the flow of existence.

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:52 pm


Kalau step ama begin step.... aku masih kurang ngerti :hmm:
Soalnya gameku gak pernah pakai itu pun baik-baik aja :hmm:

Sebenarnya kurang perlu sih menurutku soalnya aku lebih memakai Step pun game jalan dengan baik.

Tp kalau mau referensinya dari help:

Quote :
The step event happens every step of the game. Here you can put actions that need to be executed continuously. For example, if one object should follow another, here you can adapt the direction of motion towards the object we are following. Be careful with this event though. Don't put many complicated actions in the step event of objects of which there are many instances. This might slow the game down.

To be more precise, there are three different step events. Normally you only need the default one. But using the menu you can also select the begin step event and the end step event.

The begin step event is executed at the beginning of each step, before any other events take place. The normal step event is executed just before the instances are put in their new positions.

The end step event is executed at the end of the step, just before the drawing. This is typically used to change the sprite depending on the current direction.



Back to top Go down
View user profile http://www.stitched.netai.net
r15n4d1
Decem


Status : pengen belajar script GML
Posts : 15
Chips : 2273
Power : 0
Join date : 2010-12-16
Age : 22
Location : pulau antah berantah

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:54 pm


hmm... begitu ya..
pas ane coba scriptny, bisa om!
tapi gimana carany biar kalo
dipencet kanan dia ganti sprite madep kanan
kalo ke kiri ya sprite kiri!
itu scriptny gimana?



Back to top Go down
View user profile http://artikelrame.blogspot.com
Vsio
Centum


Posts : 205
Chips : 2860
Power : 1
Join date : 2011-03-04
Location : Between Existence and Anti-Existence
Quote : As long I exist, I shall influence the flow of existence.

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 9:56 pm


Tinggal ditambah gini:

Code:
kecepatan = 10; // kecepatan bergerak sebesar 10 pixel
if keyboard_check(vk_up) {y -= kecepatan; sprite_index = sprite_hadap_atas;} // atas
if keyboard_check(vk_down) {y += kecepatan; sprite_index = sprite_hadap_bawah;} // bawah
if keyboard_check(vk_left) {x -= kecepatan; sprite_index = sprite_hadap_kiri;} // kiri
if keyboard_check(vk_right) {x += kecepatan; sprite_index = sprite_hadap_kanan;} // kanan



Back to top Go down
View user profile http://www.stitched.netai.net
r15n4d1
Decem


Status : pengen belajar script GML
Posts : 15
Chips : 2273
Power : 0
Join date : 2010-12-16
Age : 22
Location : pulau antah berantah

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 10:00 pm


Vsio wrote:

if keyboard_check(vk_up) {y -= kecepatan; sprite_index = sprite_hadap_atas;} // atas

kode yang "sprite_hadap_atas" itu nama spriteny atau itu kode gmlny?



Back to top Go down
View user profile http://artikelrame.blogspot.com
Vsio
Centum


Posts : 205
Chips : 2860
Power : 1
Join date : 2011-03-04
Location : Between Existence and Anti-Existence
Quote : As long I exist, I shall influence the flow of existence.

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 10:02 pm


nama spritenya. :D

Ganti ke nama sprite. :D



Back to top Go down
View user profile http://www.stitched.netai.net
r15n4d1
Decem


Status : pengen belajar script GML
Posts : 15
Chips : 2273
Power : 0
Join date : 2010-12-16
Age : 22
Location : pulau antah berantah

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 10:07 pm


thanks om! yey()
udah solve kok
lock aja ni thread!



Back to top Go down
View user profile http://artikelrame.blogspot.com
Prodixon
Head Administrator, ProDig Founder


Status : Akhirnya kembali...
Posts : 648
Chips : 4390
Power : 8
Join date : 2010-08-08
Location : ProDig
Badge :

PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Wed Apr 20, 2011 10:11 pm


Trit dikunci karena solved. thumbup()





Situsku: Stitched
Guest, kasih Internet donk gan! (Tenang, internet di sini maksudnya adalah cendol XD)

Back to top Go down
View user profile http://prodig.forumotion.net
Sponsored content




PostSubject: Re: [GM]nanya cara bikin karakter gerak   
Today at 10:07 am





Back to top Go down
 

[GM]nanya cara bikin karakter gerak

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Prodig - Komunitas Proyek Digital  :: Education Chamber :: Programming :: Request Code-
Jump to: