-
Notifications
You must be signed in to change notification settings - Fork 2
/
Background Effects.txt
118 lines (101 loc) · 2.74 KB
/
Background Effects.txt
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//----- Variables -----------------------------------------------------------------------------------------------------
bg_mode = 0
calc.char = 0
calc.return = 0
calc.temp = 0
calc.temp2 = 0
chip8.delay_timer = 0
chip8.dummy = 0
chip8.dummy2 = 0
chip8.I = 0
chip8.pc = 0
chip8.rand = 0
chip8.return = 0
chip8.sound_timer = 0
flags.met = 0
op.opcode = 0
op.pos = 0
op.temp = 0
program.done = 0
read.return = 0
read.single.return = 0
rom.name = 0
scanX = 0
scanY = 0
storage.byte = 0
tile_mode = 0
//----- Lists ---------------------------------------------------------------------------------------------------------
chip8.keyboard = { }
chip8.memory = { }
chip8.registers = { }
chip8.screen = { }
chip8.stack = { }
//----- Broadcast received events -------------------------------------------------------------------------------------
WhenBroadcastReceived(exit emulator)
{
Call get stage size;
Looks.Hide();
Sensing.ResetTimer();
Forever
{
Call render(Sensing.Timer())(GUItemp);
}
}
WhenBroadcastReceived(fade_out)
{
Pen.Clear();
Stop(other scripts in sprite);
Motion.GoTo(Blank);
Looks.Show();
Looks.SetEffectTo(GHOST, 100);
Costume.GoToFrontBack(front);
Repeat (10)
{
Looks.ChangeEffectBy(GHOST, -10);
}
Looks.SwitchBackdropTo(Black);
}
WhenBroadcastReceived(Launch EmulatorWaitd)
{
Pen.Clear();
Looks.Hide();
Stop(other scripts in sprite);
}
WhenBroadcastReceived(stop_scripts)
{
Looks.Hide();
Stop(other scripts in sprite);
}
//----- Custom blocks -------------------------------------------------------------------------------------------------
Define get stage size (warp=true)
{
Looks.Show();
Looks.SwitchCostumeTo(2x2 svg);
Motion.GoToXY(-1, 0);
Repeat Until Sensing.TouchingObject(_edge_)
{
Motion.ChangeXBy(2);
}
stage width = ((Motion.XPosition() * 2) - 2);
Looks.SwitchCostumeTo(costume1);
}
Define render(string timer)(string height) (warp=true)
{
Pen.Clear();
Pen.SetPenColorToColor(#6cb7ff);
Pen.SetPenTo(transparency, 30);
Pen.ChangePenBy(color, (Operator.Join("0x", Operator.Join(Menu Theme[5], Menu Theme[6])) / 2));
Motion.SetX((stage width / -2));
Repeat (stage width)
{
Pen.Down();
Motion.SetY((((10 * sin((Motion.XPosition() + (50 * timer)))) - (50 * sin((8 * ((Motion.XPosition() / 100) + timer))))) - height));
Motion.SetY(-180);
Pen.Clear();
Motion.SetY((((10 * sin((Motion.XPosition() + (50 * timer)))) - (50 * sin((8 * ((Motion.XPosition() / 100) + timer))))) - height));
Motion.ChangeXBy(1);
}
}
//----- Costumes ------------------------------------------------------------------------------------------------------
2x2 svg.svg
costume1.svg