diff --git a/week-04/js/main.js b/week-04/js/main.js new file mode 100644 index 0000000..df9bd66 --- /dev/null +++ b/week-04/js/main.js @@ -0,0 +1,20 @@ +import { Alert, Confirm, Prompt } from "./game-framework.js"; +/** + * Week 04 - Control Flow + */ + + + +// Modify the text for the introduction +await Alert('Welcome to my game. Answer questions and complete tasks to escape the room!') + +let name = await Prompt("What is your name?") + +// Level 1 +if(await Confirm(`Hi ${name}. Do you want to play the game?`)) { + await Alert('Great! Let\'s get started.') +} else { + await Alert('That\'s too bad. Maybe next time.') + window.location.reload() +} + diff --git a/week-04/tests.html b/week-04/tests.html new file mode 100644 index 0000000..ff4d720 --- /dev/null +++ b/week-04/tests.html @@ -0,0 +1,14 @@ + + +
+ + +