Skip to content

Commit e55f474

Browse files
committed
Step 2.14: Add test screen
1 parent 1ea23dd commit e55f474

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

resources/scripts/test_screen.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class TestScreen extends Engine.Screen {
2+
draw(context) {
3+
// A 20px sized "Georgia" font (Available natively)
4+
context.font = "20px Georgia";
5+
// The text should be colored white
6+
context.fillStyle = "white";
7+
// Draw the following message 50px from the left and 50px from the top
8+
context.fillText("This is a Test Screen", 50, 50);
9+
}
10+
};

views/game.html

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<script type="text/javascript" src="/scripts/engine/screen.js"></script>
1515
<script type="text/javascript" src="/scripts/engine/assets_loader.js"></script>
1616
<script type="text/javascript" src="/scripts/engine/game.js"></script>
17+
<script type="text/javascript" src="/scripts/test_screen.js"></script>
1718
<script type="text/javascript" src="/scripts/main.js"></script>
1819

1920
<!-- Styles -->

0 commit comments

Comments
 (0)