trb04 3 meses atrás
pai
commit
b0937db1d3

+ 1 - 1
objects/oCredit/Step_0.gml

@@ -2,7 +2,7 @@ y_spd += global.g * global.time_scale;
 
 if place_meeting(x, y + y_spd, oParentSolid)
 {
-    while !place_meeting(x, y + sign(y_spd), oParentSolid)
+    while !place_meeting(x, y + sign(y_spd), oParentSolid) //BUG HERE!!
         y += sign(y_spd);
     
     if y_spd > 2

+ 2 - 1
objects/oMain/Create_0.gml

@@ -17,6 +17,7 @@ autoreg_handle("ingame", "ingame", 1);
 autoreg_handle("title", "title", 100);
 
 global.altcontrol = false;
+global.audio_enabled = false;
 
 _jump_p = undefined;
 _jump_r = undefined;
@@ -41,7 +42,7 @@ global.inventory = noone;
 global.camera = noone;
 global.player = noone;
 
-global.difficulty = 1; // 0 = EASY, 1 = NORMAL, 2 = HARD
+global.difficulty = 2; // 0 = EASY, 1 = NORMAL, 2 = HARD
 
 // debugging
 global.developer_mode = true;

+ 5 - 12
objects/oMain/Step_0.gml

@@ -11,12 +11,6 @@ if !global.altcontrol
 	_inventory = ingame.kcp("I");
 	_focus     = ingame.kcp("A");
 	_pause     = ingame.kcp(vk_escape);
-
-	_up_title     = title.kcp(vk_up);
-	_down_title   = title.kcp(vk_down);
-	_left_title   = title.kcp(vk_left);
-	_right_title  = title.kcp(vk_right);
-	_select_title = title.kcp("Z");
 }
 else
 {
@@ -31,13 +25,12 @@ else
 	_inventory = ingame.kcp("I");
 	_focus     = ingame.kcp("U");
 	_pause     = ingame.kcp(vk_escape);
-
-	_up_title     = title.kcp("W");
-	_down_title   = title.kcp("S");
-	_left_title   = title.kcp("A");
-	_right_title  = title.kcp("D");
-	_select_title = title.kcp("J");
 }
+_up_title     = title.kcp(vk_up)    || title.kcp("W");
+_down_title   = title.kcp(vk_down)  || title.kcp("S");
+_left_title   = title.kcp(vk_left)  || title.kcp("A");
+_right_title  = title.kcp(vk_right) || title.kcp("D");
+_select_title = title.kcp("Z")      || title.kcp("J");
 
 _left_inv  = inventory.kcp(vk_left);
 _right_inv = inventory.kcp(vk_right);

+ 1 - 15
objects/oPlayer/Step_0.gml

@@ -21,18 +21,4 @@ if invincible_timer > 0
 	flash_timer = abs(sin(current_time * 0.01));
 }
 
-
-var _threshold = 2;
-if global.playerHP <= _threshold
-{
-    var _vol = 1// - (global.playerHP / _threshold) * 0.5;
-    audio_sound_gain(heartbeat_sound, _vol, 100);
-    
-    var _bgm_vol = oAudioManager.bgm_volume * (1 - _vol * 0.7); // 最低压到40%
-    audio_sound_gain(oAudioManager.bgm_current, _bgm_vol, 100);
-}
-else
-{
-    audio_sound_gain(heartbeat_sound, 0, 200);
-    audio_sound_gain(oAudioManager.bgm_current, oAudioManager.bgm_volume, 200); // 恢复
-}
+sfx_heartbeat_play();

+ 29 - 0
scripts/AudioManager/AudioManager.gml

@@ -1,5 +1,8 @@
 function bgm_play(_key)
 {
+	if !global.audio_enabled
+		return;
+		
     var _mus = oAudioManager.bgm_map[$ _key];
     if _mus == undefined exit;
     
@@ -12,12 +15,18 @@ function bgm_play(_key)
 
 function bgm_stop()
 {
+	if !global.audio_enabled
+		return;
+
     audio_stop_sound(oAudioManager.bgm_current);
     oAudioManager.bgm_current = noone;
 }
 
 function sfx_play(_key, _pitch_vary = 0.1, _vol_vary = 0.1)
 {
+	if !global.audio_enabled
+		return;
+	
     var _sfx = oAudioManager.sfx_map[$ _key];
     var _inst = audio_play_sound(_sfx, 1, false);
     
@@ -27,4 +36,24 @@ function sfx_play(_key, _pitch_vary = 0.1, _vol_vary = 0.1)
     audio_sound_pitch(_inst, _pitch);
     audio_sound_gain(_inst, _vol, 0);
     return _inst;
+}
+function sfx_heartbeat_play()
+{
+	if !global.audio_enabled
+		return;
+		
+	var _threshold = 2;
+	if global.playerHP <= _threshold
+	{
+	    var _vol = 1// - (global.playerHP / _threshold) * 0.5;
+	    audio_sound_gain(heartbeat_sound, _vol, 100);
+    
+	    var _bgm_vol = oAudioManager.bgm_volume * (1 - _vol * 0.7);
+	    audio_sound_gain(oAudioManager.bgm_current, _bgm_vol, 100);
+	}
+	else
+	{
+	    audio_sound_gain(heartbeat_sound, 0, 200);
+	    audio_sound_gain(oAudioManager.bgm_current, oAudioManager.bgm_volume, 200); // 恢复
+	}
 }