Run Our Code in VS Code
We can go to the VS Code Official Site to down the VS Code Editor. After you have installed VS Code, we create an empty folder and open VS Code on it.
For the games we created in jsKidz, we need to create a HTML page and main.js file and link them together.
- We create some basic HTML first:
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
</head>
<body>
<!-- Style & HTML come here -->
<script src="./main.js" type="module">
</body>
</html>
We need jQuery for Simple Component Games and it is no harm to have for Canvas Games too.
-
We then create the same Js files including main.js from the modules in the same folder/directory. Once you complete the copy and paste of the codes. We just need to run it. To run it, we should install Live Server Extension, which will show the game on your browser with the minimum effort.
Run Live Server
We go to Code > Preferences > Extensions to install an extension called Live Server as below.
Once the extension is installed, you can right click on the index.html file and choose "Open with Live Server".
The Chrome page will be automatically open on http://127.0.0.1:5500/YOUR_FILE
.