Skip to content

Commit efc317a

Browse files
committed
add blin
1 parent 0582419 commit efc317a

File tree

7 files changed

+96
-63
lines changed

7 files changed

+96
-63
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
for (var i=0; i<num_controls; i++) {
22
draw_text(8, i*32 + 16, control_labels[i] + ": " + string(my_player.get_control_state(i, CONTROL_STATE.HELD)));
3-
}
3+
}
4+
5+
// for (i=0; i<8; i++) {
6+
// draw_text(640, i*32, string(device_mouse_x(i)) + ", " + string(device_mouse_y(i)));
7+
// }

current-scripts/Demos/useful-scripts/options/ios/options_ios.yy

Lines changed: 23 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

current-scripts/Demos/useful-scripts/options/tvos/options_tvos.yy

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

current-scripts/Demos/useful-scripts/options/windows/options_windows.yy

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

current-scripts/Demos/useful-scripts/scripts/control_manager_structs/control_manager_structs.gml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,40 @@ enum CONTROL_STATE {
2525
}
2626

2727
function ControlManagerPlayer() constructor {
28+
keyboard_enabled = true;
29+
gamepad_enabled = true;
30+
touch_enabled = true;
31+
tilt_enabled = true;
32+
gamepad_slot = 0;
33+
gamepad_stick_enabled = true;
34+
gamepad_stick_to_dpad = true;
35+
stick_deadzone = 0.1;
36+
stick_threshold = 0.5;
37+
max_touches = 8;
38+
39+
// Mappable Controls
2840
for (var i=0; i<CONTROLS.MAX; i++) {
2941
keyboard_map[i] = -1;
30-
keyboard_control_source[i] = CONTROL_TYPE.KEYBOARD;
42+
// keyboard_control_source[i] = CONTROL_TYPE.KEYBOARD;
3143
gamepad_map[i] = -1;
44+
touch_map[i] = -1;
3245

3346
ctrl_held[i] = false;
3447
ctrl_pressed[i] = false;
3548
ctrl_released[i] = false;
3649
}
3750

3851
ctrl_any_pressed = false;
52+
53+
// Always tracked controls
54+
// Gamepad
3955
axis_held = new Vector2(0, 0);
4056
axis_pressed = new Vector2(0, 0);
4157
stick_input = new Vector2(0, 0);
4258
prev_stick_input = new Vector2(0, 0);
4359

44-
keyboard_enabled = true;
45-
gamepad_enabled = true;
46-
gamepad_slot = 0;
47-
gamepad_stick_enabled = true;
48-
gamepad_stick_to_dpad = true;
49-
stick_deadzone = 0.1;
50-
stick_threshold = 0.5;
60+
// Touch
61+
5162

5263
function set_control_map(_control_type, _control_source, _control, _value) {
5364
if (_control_type == CONTROL_TYPE.KEYBOARD) {

current-scripts/Demos/useful-scripts/scripts/math_functions/math_functions.gml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ function pulse(_t, _min, _max) {
6363
: 0;
6464
}
6565

66+
/// @func blin(a, b, c, d, w1, w2)
67+
/// @param {real} a
68+
/// @param {real} b
69+
/// @param {real} c
70+
/// @param {real} d
71+
/// @param {real} w1
72+
/// @param {real} w2
73+
function blin(a, b, c, d, w1, w2) {
74+
var _ab = lerp(a, b, w1);
75+
var _cd = lerp(c, d, w1);
76+
return lerp(_ab, _cd, w2);
77+
}
78+
6679

6780
/// @func soft_ceiling(value, delta, max)
6881
/// @desc Allows values higher than max to go below, but not values lower than max to go above

current-scripts/Demos/useful-scripts/useful-scripts.yyp

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)