1 |
if (init == 0) |
2 |
{ |
3 |
if (ord(myString) <= 57) |
4 |
textImage = ord(myString) - 22; |
5 |
else |
6 |
textImage = ord(string_upper(myString)) - 65; |
7 |
init = 1; |
8 |
} |
9 |
var checkPress = 0; |
10 |
if (i_ex(obj_actor) && !pressed && pressable && global.interact == 0) |
11 |
{ |
12 |
if (place_meeting(x, y, obj_actor)) |
13 |
checkPress = 1; |
14 |
} |
15 |
if (checkPress) |
16 |
{ |
17 |
if (pressed == 0) |
18 |
{ |
19 |
pressedBuffer = 2; |
20 |
pressed = 1; |
21 |
var _snd = snd_play(asset_get_index("snd_speak_and_spell_" + myString)); |
22 |
var _volume = (buttonIndex == 7) ? 1 : max(1 - (buttonIndex / 4), 0); |
23 |
audio_sound_gain(_snd, _volume, 0); |
24 |
alarm[0] = 30;gml_Object_obj_ch2_keyboardpuzzle_solo_tile_Alarm_0.gmlvar _forcefield = instance_nearest(x + 120, y - 200, obj_forcefield);
if (!i_ex(_forcefield))
exit;
if (buttonIndex == 0)
instance_destroy(_forcefield);
with (_forcefield)
{
x -= 240;
y += 160;
with (solid1)
{
x -= 240;
y += 160;
}
} |
25 |
controller.finalString += myString; |
26 |
controller.buttonx = x; |
27 |
down = true; |
28 |
} |
29 |
} |
30 |
else if (pressable && global.interact == 0) |
31 |
{ |
32 |
if (pressedBuffer <= 0) |
33 |
pressed = 0; |
34 |
} |