Skip to main content

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.

  1. 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.

  1. 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.

    Live Server Extension

Run Live Server

We go to Code > Preferences > Extensions to install an extension called Live Server as below.

Live Server Extension

Once the extension is installed, you can right click on the index.html file and choose "Open with Live Server".

Open with Live Server

The Chrome page will be automatically open on http://127.0.0.1:5500/YOUR_FILE.

Now your game is live on your local Chrome brwoser!

Open with Live Server