Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_card_game_card_Step_0

(view raw script w/o annotations or w/e)
1
if obj_card_game_controller.cardg_failure
2
    image_alpha = 0
3
if card_success
4
{
5
    image_xscale = lerp(image_xscale, 0, 0.4)
6
    image_yscale = lerp(image_yscale, 0, 0.4)
7
    image_angle += 15
8
    if (image_xscale <= 0.1)
9
        instance_destroy()
10
    return;
11
}
12
if (card_is_selected == true)
13
{
14
    depth = -1000099
15
    image_xscale = lerp(image_xscale, 1.25, 0.3)
16
    image_yscale = lerp(image_yscale, 1.25, 0.3)
17
}
18
else
19
{
20
    image_xscale = lerp(image_xscale, 1, 0.3)
21
    image_yscale = lerp(image_yscale, 1, 0.3)
22
}
23
if ((!card_is_active) || card_number >= 20)
24
{
25
    card_is_active = false
26
    return;
27
}
28
depth = -999999 - card_number
29
card_row = card_number div 5
30
card_column = card_number % 5
31
card_target_x = card_original_x + 38 * card_column
32
card_target_y = card_original_y + 47 * card_row
33
x = lerp(x, card_target_x, 0.3)
34
y = lerp(y, card_target_y, 0.3)
35
if (round(x) == card_target_x && round(y) == card_target_y)
36
    card_is_active = false
37
card_is_selected = false