CS-Coursework/website/screens/startscreen.js

33 lines
793 B
JavaScript
Raw Normal View History

2022-11-28 11:04:49 +00:00
/**
* @file This file is the base screen when the user visits the site
* @author Arlo Filley
*/
/**
* This screen class is the base screen. It provides the user with basic instructions
* and a set of menus to navigate the site
*/
2022-10-11 09:45:40 +01:00
class StartScreen {
constructor() {
2022-11-18 14:51:05 +00:00
this.menu = new Menu();
2022-10-11 09:45:40 +01:00
}
draw() {
background("#eeeee4");
textSize(100);
textAlign(CENTER, CENTER);
2022-11-11 13:04:13 +00:00
fill("#000");
2022-10-11 09:45:40 +01:00
text("Press enter to start test", 0, 0, windowWidth - 100, windowHeight - 100);
2022-11-18 11:33:25 +00:00
2022-11-18 14:51:05 +00:00
this.menu.draw();
2022-11-18 11:33:25 +00:00
fill("#000");
2022-11-18 12:27:54 +00:00
text(`Logged in as ${user.username}`, windowWidth-400, 15);
2022-11-11 13:04:13 +00:00
}
letterTyped(key) {
if (key === "Enter") {
screenManager.setScreen(new TestScreen());
}
2022-10-11 09:45:40 +01:00
}
}