1/28/25, 2:07 PM [Link].
io/codePrint/
1 //WELCOME TO THE CODE!!!
2 //This sets the starting button to loading so all the lists can load while the player is not confused.
3 setProperty("Begin", "text", "Loading . . .");
4 setProperty("Begin", "background-color", rgb(100, 100, 100));
5
6 //Here is almost every variable in the program here when the button is showing that it is loading, there is also every list here.
7
8 var game = getColumn("Video Game Reviews from IGN", "title");
9 var playstation = getColumn("Video Game Reviews from IGN", "playstation");
10 var xbox = getColumn("Video Game Reviews from IGN", "xbox");
11 var nintendo = getColumn("Video Game Reviews from IGN", "nintendo");
12 var pc = getColumn("Video Game Reviews from IGN", "pc");
13 var other = getColumn("Video Game Reviews from IGN", "other");
14 var score = getColumn("Video Game Reviews from IGN", "score");
15 var genre = getColumn("Video Game Reviews from IGN", "genre");
16 var release = getColumn("Video Game Reviews from IGN", "release_year");
17 var filter1Game = [];
18 var filter1Score = [];
19 var filter1Release = [];
20 var filter1Genre = [];
21 var filter2Game = [];
22 var filter2Score = [];
23 var filter2Release = [];
24 var filter3Game = [];
25 var filter3Score = [];
26 var filter3Release = [];
27 var randomColor = randomNumber(1, 3);
28 var r;
29 var g;
30 var b;
31 var num = 0;
32
33 //Once the variables are finished loading, the button is not loading and is able to be clicked on.
34 setProperty("Begin", "text", "begin");
35 setProperty("Begin", "background-color", rgb(178, 45, 46));
36
37 //Updates the text below the slider when the player moves it.
38
39 onEvent("slider1", "click", function( ) {
40 setProperty("text_area5", "text", getProperty("slider1", "value"));
41 });
42
43
[Link] 1/5
1/28/25, 2:07 PM [Link]/codePrint/
44 //Goes to next screen when begin is clicked
45
46 onEvent("Begin", "click", function( ) {
47 setScreen("screen2");
48 });
49
50 //This resets the filters once the player goes back to the start.
51
52 onEvent("button4", "click", function( ) {
53 setScreen("screen1");
54 filter1Game = [];
55 filter1Score = [];
56 filter1Release = [];
57 filter1Genre = [];
58 filter2Game = [];
59 filter2Score = [];
60 filter2Release = [];
61 filter3Game = [];
62 filter3Score = [];
63 filter3Release = [];
64 });
65
66 //Once the console of choice is picked by the player, the colors will update based on the console.
67
68 onEvent("dropdown2", "click", function( ) {
69 if (getProperty("dropdown2", "text") == "playstation") {
70 color(0, 0, 255);
71 }
72 if (getProperty("dropdown2", "text") == "nintendo") {
73 color(255, 0, 0);
74 }
75 if (getProperty("dropdown2", "text") == "xbox") {
76 color(0, 200, 67);
77 }
78 if (getProperty("dropdown2", "text") == "pc") {
79 for (var i = 1; i < 11; i++) {
80 randomColor = randomNumber(1, 3);
81 if (randomColor == 1) {
82 r = 255;
83 g = 0;
84 b = 0;
85 } else if ((randomColor == 2)) {
86 g = 200;
87 r = 0;
88 b = 67;
89 } else {
[Link] 2/5
1/28/25, 2:07 PM [Link]/codePrint/
90 b = 255;
91 g = 0;
92 r = 0;
93 }
94 setProperty("text_area" + i, "background-color", rgb(r, g, b));
95 }
96 }
97 if (getProperty("dropdown2", "text") == "other") {
98 color(112, 112, 112);
99 }
100 });
101
102 //Once the get chosen games button is click. This puts on a loading screen then filters every game by choice and then displays the final result.
103
104 onEvent("button1", "click", function( ) {
105 setProperty("button1", "text", "Loading . . .");
106 setProperty("button1", "background-color", rgb(100, 100, 100));
107 var Genere = getProperty("dropdown1", "text");
108 var Console = getProperty("dropdown2", "text");
109 var Rating = getProperty("slider1", "value");
110 for (var i = 0; i < [Link]; i++) {
111 if (Console == "playstation") {
112 if (playstation[i] == "TRUE") {
113 append(i);
114 }
115 } else if ((Console == "xbox")) {
116 if (xbox[i] == "TRUE") {
117 append(i);
118 }
119 } else if ((Console == "nintendo")) {
120 if (nintendo[i] == "TRUE") {
121 append(i);
122 }
123 } else if ((Console == "pc")) {
124 if (pc[i] == "TRUE") {
125 append(i);
126 }
127 } else {
128 if (other[i] == "TRUE") {
129 append(i);
130 }
131 }
132 }
133 filter(Genere);
134 filter(Rating);
135 setScreen("screen3");
[Link] 3/5
1/28/25, 2:07 PM [Link]/codePrint/
136 setProperty("button1", "text", "Get chosen games");
137 setProperty("button1", "background-color", rgb(178, 45, 46));
138 num = 0;
139 update();
140 });
141
142 //This updates the game on the game screen back one and updates the game.
143
144 onEvent("leftArrow", "click", function( ) {
145 num = num - 1;
146 if (num < 0) {
147 num = [Link] - 1;
148 }
149 update();
150 });
151
152 //This updates the game on the game screen forward one and updates the game.
153
154 onEvent("rightArrow", "click", function( ) {
155 num = num + 1;
156 if ([Link] - 1 < num) {
157 num = 0;
158 }
159 update();
160 });
161
162 //Below this spot are all functions:
163 //The update function gets the text areas for the results screen and updates the game that scows up on the results screen.
164 //If no game pops up a special screen appears to say so.
165
166 function update() {
167 if ([Link] > 0) {
168 setProperty("text_area8", "text", filter3Game[num]);
169 setProperty("text_area9", "text", "IGN score: " + filter3Score[num]);
170 setProperty("text_area10", "text", "Released in " + filter3Release[num]);
171 } else {
172 setProperty("text_area8", "text", "No game avalable");
173 setProperty("text_area9", "text", "Mabye lower your score prefrence");
174 setProperty("text_area10", "text", "Good luck :D");
175 }
176 }
177
178 //The filter function filters the games across things like genre of choice and prefered score.
179
180 function filter(thing) {
181 for (var i = 0; i < [Link]; i++) {
182
[Link] 4/5
1/28/25, 2:07 PM [Link]/codePrint/
182
if (thing == filter1Genre[i]) {
183
appendItem(filter2Game, filter1Game[i]);
184
appendItem(filter2Score, filter1Score[i]);
185
appendItem(filter2Release, filter1Release[i]);
186
}
187
}
188
for (var e = 0; e < [Link]; e++) {
189
if (filter2Score[e] >= thing) {
190
appendItem(filter3Game, filter2Game[e]);
191
appendItem(filter3Score, filter2Score[e]);
192
appendItem(filter3Release, filter2Release[e]);
193
}
194
}
195
}
196
197
//The append function is for when filtering the console choice and adding the sevreal filtered lists as needed.
198
199
function append(i) {
200
appendItem(filter1Game, game[i]);
201
appendItem(filter1Score, score[i]);
202
appendItem(filter1Release, release[i]);
203
appendItem(filter1Genre, genre[i]);
204
}
205
206
//The color function gives color to the text areas depending on the console of choice, pc does somthing thats not in a function.
207
208
function color(r, g, b) {
209
for (var e = 1; e < 11; e++) {
210
setProperty("text_area" + e, "background-color", rgb(r, g, b));
211
}
212
}
PDF document made with CodePrint using Prism
[Link] 5/5