-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_3.js
71 lines (62 loc) · 1.73 KB
/
test_3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
({
/* background stats card image (without headshot) */
background: load_asset("BACKGROUND_REPLACEMENT_STRING"),
/* where to position the background png */
background_x: 0,
background_y: 0,
background2_y_offset: 1030,
x: 353,
y: 885,
fade_back: true,
fade_bottom: false,
done: false, //when fade_out has completed
/*
* these are used to keep track of the looping
*/
fade_out: false,
back_opacity: 0,
/* render one frame of the looped animation */
render: function() {
//handle animating the stats card
if (this.done == false){
if(this.fade_back == true && this.back_opacity <= 235)
{
this.back_opacity = this.back_opacity + 20;
}
else if(this.fade_back == true)
{
this.back_opacity = 255;
this.fade_bottom = true;
this.fade_back = false;
}
if(this.fade_bottom == true && this.background2_y_offset >890)
{
this.background2_y_offset = this.background2_y_offset - 8;
}
else if(this.fade_bottom == true && this.background2_y_offset <=890)
{
this.fade_bottom = false;
}
if (this.fade_out == true && this.back_opacity <= 17){
this.back_opacity = 0;
this.fade_out = false;
this.done = true;
}
else if (this.fade_out == true){
this.back_opacity = this.back_opacity - 17;
}
draw(this.background, 0, this.background2_y_offset, this.background_x, this.background_y+885, this.x, this.y, this.back_opacity);
// x, y (for image start) x,y for putting sizex sizy opacity
}
},
command: function(data){
if(data != 'cut'){
this.fade_out = true;
}
else{
this.back_opacity = 0;
this.fade_opacity = 0;
this.done = true;
}
}
});