MCPcopy Create free account
hub / github.com/defold/defold / randomGame

Method randomGame

editor/src/java/com/defold/editor/Splash.java:77–101  ·  view source on GitHub ↗
(Scene scene)

Source from the content-addressed store, hash-verified

75 }
76
77 private static void randomGame(Scene scene) {
78 List<String[]> games = new ArrayList<>();
79
80 games.add(new String[]{"Family Island", "/games/familyisland.jpg"});
81 games.add(new String[]{"Solitaire Jazz Travel", "/games/solitairejazztravel.jpg"});
82 games.add(new String[]{"Duo Zombies", "/games/duozombies.jpg"});
83 games.add(new String[]{"Fates of Ort", "/games/fatesofort.jpg"});
84 games.add(new String[]{"Plague Lords", "/games/plaguelords.jpg"});
85 games.add(new String[]{"Void Scrappers", "/games/voidscrappers.jpg"});
86 games.add(new String[]{"Monkey Mart", "/games/monkeymart.jpg"});
87 games.add(new String[]{"Look Your Loot", "/games/lookyourloot.jpg"});
88 games.add(new String[]{"Warnament", "/games/warnament.jpg"});
89 games.add(new String[]{"Craftomation 101", "/games/craftomation101.jpg"});
90 games.add(new String[]{"BORE BLASTERS", "/games/boreblasters.jpg"});
91 games.add(new String[]{"Skull Horde", "/games/skullhorde.jpg"});
92 games.add(new String[]{"SuperWEIRD", "/games/superweird.jpg"});
93 games.add(new String[]{"Tiny Racing", "/games/tinyracing.jpeg"});
94
95 String[] game = games.get(randomInt(games.size()));
96
97 ImageView gameScreenshot = (ImageView) scene.lookup("#game-screenshot");
98 gameScreenshot.setImage(new Image(game[1]));
99 Label gameNameLabel = (Label) scene.lookup("#game-name");
100 gameNameLabel.setText(game[0]);
101 }
102
103 public void show() throws IOException {
104 Object root = FXMLLoader.load(this.getClass().getResource("/splash.fxml"));

Callers 1

showMethod · 0.95

Calls 4

randomIntMethod · 0.95
addMethod · 0.65
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected