Fangames > Programming Questions

game maker help

<< < (4/6) > >>

Rpup:
Hey again, on my first screen when pressing R to restart it doesnt take me to the start of that screen. Which script do i need to change?

Also the save box isnt appearing when i run the game even though it is on the room editior. Not sure how to fix this

Olivebates:
For your first question, you need to have an object, that has an event for "When 'R' is pressed", and put the "restart room" command in that event. Then you place that object in every room of the game. Alternatively to placing it in every room in the game, you can check the box called "persistant" in the object editor window. Then only place the object in the very first room of the game. "persistant" means that the object will carry on, to every other room of the game. The "world" object, is already set as a persistant object. So all you need to do, is put the command into that object.


Your second question; please post the info on the save object that isn't spawning, the same way you did earlier:

--- Quote from: Rpup on December 03, 2013, 01:41:07 PM ---sorry, is this any better? https://imgur.com/Ha4VlHe

--- End quote ---

Rpup:

I think i fixed the save box problem however I now have a new problem.

I changed the menuselect code to take you to the first screen, which is fine, however it doesnt seem to be saving the game, so everytime i exit and replay it starts from the first screen again even though it says the time and death count on that menu icon.

Thanks for any help =)

Olivebates:
We aren't really sitting with the engine open ourselves, it would help us help you if you would post the code.

Rpup:
Hi, sorry about that. Here is the code I menuselect code that i changed


--- Code: ---//カーソル移動
if(keyboard_check_pressed(global.leftbutton) == true){
  sound_play(sndJump);
  select -= 1;
  if(select < 1){
    select = 3;
  }
}else if(keyboard_check_pressed(global.rightbutton) == true){
  sound_play(sndJump);
  select += 1;
  if(select > 3){
    select = 1;
  }
}else if(keyboard_check_pressed(global.jumpbutton) == true){
  global.savenum = select;
  room_goto(sampleroom04);
}
--- End code ---



I was also wondering how to play music with the play music icon. I dont want to play music from the game maker event because I dont want it to keep repeating. I read an earlier topic about this and it said to type if !sound_isplaying(song) { sound_loop(song); } on the creation code

Only problem is this is the code for the music player
 
--- Code: ---//音楽を鳴らす
/**
詳しくは、Roomに配置されているplayMusicを
Ctrl押しながら右クリックをして
「CreationCode vを選択して中を覗いて下さい。
そこで、再生するSoundが宣言されています。
**/
--- End code ---

so im not really sure how to get my track playing with that code

Thanks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version