Membuat Game Online Sederhana Dengan Game Maker 8.0
+6
Rizky Wahyu
glupfruxx
indrakhucuy
sealovers
Kevin Blaze Coolerz
KirA
10 posters
Halaman 1 dari 1
Membuat Game Online Sederhana Dengan Game Maker 8.0
halo sobat-sobat Game Maker User.
post pertama kali aku isi dengan tutorial membuat game dengan Game Maker 8.0 Pro.
untuk yg belum punya GM8.0Pro download di google... hehehe
semak ya....
1. buat Sprite untuk Player. dan namai dengan "player" tampa tanda kutip.
2. masukan scripts untuk membuat koneksinya dengan cara filenya di drag ke Game Maker. ([You must be registered and logged in to see this link.])
3. buat Object beri nama "control" tanpa kutip. Add Event > Create. dan masukan Action Script:
- Code:
//Script ini untuk bergabung/menyambungkan koneksi ke game
mplay_init_tcpip(get_string("Enter ip to connect to:","127.0.0.1"));//memulai keneksi ke game dengan IP
if !mplay_connect_status()=2 //koneksi sukses
{
show_message("Failed to connect");//jika tidak sukses akan keluar pesan seperti disamping
game_end();//dan game akan close otomatis
exit;
}
if show_question("Host?")//bertanya, apa kamu menjadi HOST/SERVER
{
global.host=true;
global.playerlist="|";
mplay_session_create("ses1",0,"server");
}
else
{
global.host=false;
if mplay_session_find()>0
{
mplay_session_join(0,get_string("Enter your name:","Dave")); //pesan pemberian nama player di game
}
else
{
show_message("No session found.");//jika SERVER/HOST tidak ada(belum dibuat/keluar/tidak terhubung) maka akan keluar pesan itu.
game_end();//dan game keluar otomatis
exit;
}
}
global.players=1;
Add Event>Step. Masukan Action Script:
- Code:
if global.host//if we are the host
{
if mplay_message_receive(0)//check for messages
{
if mplay_message_id()=1//if client asks to join
{
if mplay_message_value()=1//no reason for this, really...
{
//add player
global.players+=1;//add 1 to the number of players
inst=instance_create(10,10,other_player);//create the player
inst.my_id=global.players;//give this player its id
mplay_message_send_guaranteed(mplay_message_player() ,1,string(global.players)+global.playerlist);//send client its id, and info on other players
global.playerlist+=string(global.players)+"|";//add this player to the player list
}
}
if mplay_message_id()=2
{
//remove player
v=mplay_message_value();//v = id of player to remove
with other_player //check all instances of other_player
{ //for the one with the right id
if my_id=other.v//if it has the right id
{
instance_destroy();//fragmentate it
global.playerlist=string_replace(global.playerlist,"|"+string(my_id)+"|","|");//remove from player list
//note, we don't -1 from the global.players, as this is used to set ids, so would cause serious errors.
}
}
}
if mplay_message_id()=4//create bullet
{
explode_script(mplay_message_value(),"|");//make like a banana string
inst=instance_create(x,y,ghost_bullet);//create ghost bullet
inst.x=real(explode[0]);//start x of bullet
inst.y=real(explode[1]);//start y of bullet
inst.direction=real(explode[2]);//direction of bullet
inst.speed=real(explode[3]);//bullet speed
inst.my_id=real(explode[4]);//id of creator
}
}
}
Add Event>Begin Step. Masukan Action Script:
- Code:
if !global.host//if not the host
{
if mplay_message_receive(0)//if we get a message
{
if mplay_message_id()=1//server is sending us our id (and data on other players)
{
make_players(mplay_message_value());//use the player data to make them
mplay_message_send_guaranteed(0,3,player.my_id);//tell other users that im here
}
if mplay_message_id()=2//a player is leaving
{
v=mplay_message_value();//which one?
with other_player//check all
{
if my_id=other.v instance_destroy();//this one! destroy...
}
}
if mplay_message_id()=3//a player is joining
{
inst=instance_create(10,10,other_player);//create him (or her)
inst.my_id=mplay_message_value();//give its ghost object the id
}
if mplay_message_id()=4//create bullet
{
explode_script(mplay_message_value(),"|");//make like a banana string
inst=instance_create(x,y,ghost_bullet);//create ghost bullet
inst.x=real(explode[0]);//start x of bullet
inst.y=real(explode[1]);//start y of bullet
inst.direction=real(explode[2]);//direction of bullet
inst.speed=real(explode[3]);//bullet speed
inst.my_id=real(explode[4]);//id of creator
}
if mplay_message_id()=5//host quit
{
show_message("Host has left the game. Goodbye.");
game_end(); //haha kicked out
exit;
}
}
}
Add Event>Game End. Masukan Action Script:
- Code:
if !global.host//if we are not the host, tell everyone we are leaving. otherwise, kick them all out!
{
mplay_message_send_guaranteed(0,2,player.my_id);
}
else
{
mplay_message_send_guaranteed(0,5,1);
}
4.buat Object dengan nama "player" tanpa kutip. masukan Event berikut:
Add Event>Create dan masukan Action Script:
- Code:
my_speed=5;//player mempunyai speed 5
if !global.host
{
mplay_player_find();
p=mplay_player_name(1);
mplay_message_send_guaranteed(p,1,1);
my_id=-1;
}
else my_id=1;
- Code:
mplay_data_write(my_id,string(x)+"|"+string(y)+"|"+string(image_angle)+"|");
if keyboard_check(vk_up)
{
y-=5
image_angle=90
direction=90
}
if keyboard_check(vk_down)
{
y+=5
image_angle=270
direction=270
}
if keyboard_check(vk_left)
{
x-=5
image_angle=180
direction=180
}
if keyboard_check(vk_right)
{
x+=5
image_angle=0
direction=0
}
5. Buat Sprite dengan nama "other_player" tanpa kutip.
6. Buat Object dengan nama "other_player" tanpa kutip.
Add Event>Step. masukan Action Script:
- Code:
data=mplay_data_read(my_id);//read data of player you are ghosting for
explode_script(data,"|");//split the data into something you can read
x=real(explode[0]);//go to position
y=real(explode[1]);//go to position
image_angle=real(explode[2]);//set image_angle
dan ok...
5. buat room..
6. taruh Object control dulu lalu Object player.
jadi deh,, dan test...
ini file contoh GMK ([You must be registered and logged in to see this link.])
//Kamu harus jadi host jika ingin teman-temanmu terkoneksi ke game kamu...
dan alamat IP harus punya kamu. beri temanmu alamat IP kamu, dan main deh,,,,
kalo bisa sertakan credits
bila ada masalah / kurang jelas bisa komentar.. ^^
Terakhir diubah oleh ~ F_Kz ~ tanggal Tue 08 Jan 2013, 15:48, total 2 kali diubah (Reason for editing : Update Tutorial)
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
sorry nie kalo ga ke'LINK.
cz aku member baru. jadi gabisa nge'LINK kalo gak menetap disini selama 7 hari
cz aku member baru. jadi gabisa nge'LINK kalo gak menetap disini selama 7 hari
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
jangan post link ny kalo bsa di copas kesini. aku aja gk promosi blog walau ak admin ny
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
Kevin Blaze Coolerz wrote:jangan post link ny kalo bsa di copas kesini. aku aja gk promosi blog walau ak admin ny
sorry
ga tau aku..
thanks uda di edit
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
~ F_Kz ~ wrote:Kevin Blaze Coolerz wrote:jangan post link ny kalo bsa di copas kesini. aku aja gk promosi blog walau ak admin ny
sorry
ga tau aku..
thanks uda di edit
ok gpp
seep, sama"
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
kk kalo supaya server bisa melihat akun client gimana tuh????
sealovers- Newbie
-
Jumlah posting : 82
Points : 86
Join date : 17.01.13
Lokasi : Garut
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
indrakhucuy wrote:
kira" bisa ga gan di gunakan di GM 8.1..???
jelas bisa
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
Tapi ane coba gan,,
di "step" ad yg error di line 33
di "Begin step" yg error
kira" kenapa ya gan,,??
mohon bantuannya..
di "step" ad yg error di line 33
di "Begin step" yg error
kira" kenapa ya gan,,??
mohon bantuannya..
Error
glupfruxx wrote:@indrakhucuy : errornya kaya gimana??
waktu di copas,, scriptnya ada yg error gtu,,
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
wih ......... ini nih yg lagi ku cari dari hari itu gak dapat dapat , thx ...
Tamu- Tamu
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
Mau tanyak nih harus pake dll gak?
Rizky Wahyu- Newbie
-
Jumlah posting : 28
Points : 37
Join date : 22.06.13
Age : 21
Lokasi : Jawa Tengah
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
gan, sekarang function mplay_ udah obsolete di GM:S. Ada gak cara lain? Apakah harus pake dll untuk di GM:S??
Dan apakah multiplayer di GM:S itu work di semua platform? (Karna ane butuhnya di Android.)
Dan apakah multiplayer di GM:S itu work di semua platform? (Karna ane butuhnya di Android.)
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
meliaz:
GMS kan udah punya bnyk cara utk konek ke internet, cz itu kan emg sangat di butuhkan utk platform seperti iOs dan android
tpi ak jarang pke GMS, ak baru" ini berahli ke GMS, jdi kurang tau pke fungsi & dll apa
GMS kan udah punya bnyk cara utk konek ke internet, cz itu kan emg sangat di butuhkan utk platform seperti iOs dan android
tpi ak jarang pke GMS, ak baru" ini berahli ke GMS, jdi kurang tau pke fungsi & dll apa
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
kalo di GM 8 bikin Server Client ama sistem chatingan gimana?? Bisa gk di GML ?? ato biasanya pake 39dll?? Kalo misalkan bisa di GML tolong kasih tau gan:bingung:
fazryy.fathonirahmat- Newbie
-
Jumlah posting : 40
Points : 39
Join date : 09.04.13
Age : 25
Lokasi : Bandung , Jawabarat
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
^
mplay_message_send(player,id,val)
mplay_message_receive(player)
mplay_message_send(player,id,val)
mplay_message_receive(player)
Asuna- Global Moderator
-
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13
Re: Membuat Game Online Sederhana Dengan Game Maker 8.0
^
dan jangan malas baca yamplay_message_send(player,id,val)
sends a message to the indicated player (either an identifier or a name; use 0 to send the message to all players). id is an integer message identifier and val is the value (either a real or a string). The message is sent in non-guaranteed mode. If val contains a string the maximal string length allowed is 30000 characters.
mplay_message_receive(player)
receives the next message from the message queue that came from the indicated player (either an identifier or a name). Use 0 for messages from any player. The routine returns whether there was indeed a new message.
Asuna- Global Moderator
-
Jumlah posting : 1711
Points : 1901
Join date : 10.01.13
Similar topics
» FisherCS Presentations "Mudah Membuat Game dengan Game Maker - Seri Pertama"
» tutorial 3D game dengan game maker
» Awal perkenalan dengan GAME MAKER
» [Saran]Challenge membuat game dengan sprite yang disediakan :D
» Apa yang membuat kamu ingin membuat game sendiri?
» tutorial 3D game dengan game maker
» Awal perkenalan dengan GAME MAKER
» [Saran]Challenge membuat game dengan sprite yang disediakan :D
» Apa yang membuat kamu ingin membuat game sendiri?
Halaman 1 dari 1
Permissions in this forum:
Anda tidak dapat menjawab topik