Red Jade Series
Catch the Culprit
Stephen J. Wolf
Coding for Kids

Learn JavaScript:
Build the Catch the Culprit Game

About Coding for Kids: Learn JavaScript: Build the Catch the Culprit Game

Learn JavaScript

JavaScript is the brains behind the internet, updating websites, running games, and so much more. This book teaches you the basics of coding in JavaScript by creating a crime-solving adventure.

Learn about proper syntax, variables, and strings. Add to your skills with conditionals and loops, then explore arrays, objects, and functions.

From the start, we incorporate HTML and CSS to connect to JavaScript's inherent strength of working with webpages.

Share your creations with friends and family!

PleSe note: This is an intermediate coding challenge.

Coding for Kids: Learn JavaScript: Build the Catch the Culprit Game

Purchase Coding for Kids: Learn JavaScript: Build the Catch the Culprit Game

This Book

The focus is to teach you standard coding concepts that stretch to any programming language. Even if you switch to another language later, the lessons you learn here will benefit you.

This book is written by a science teacher with over 21 years of experience working with teens. The format of the book is a step-by-step guide through the process with repetition, and contains all the code at the end of the book. A short JavaScript reference guide is also included, as well as an exclusive website.

This book moves at a faster pace and is considered an intermediate challenge.

Start Coding JavaScript Today!

Chapter Breakdown

Excerpt

Gamestate Variable

We’re going to create one global variable, g for gamestate. This will be an object that holds all the variables we need. We’ll use the get function to set our constants inside. Head over to your “index.js” file and enter the following. We’re going to add to this later, so don’t forget about it.

  • const g =
  • {
    • get POINTS_PER_HINT () { return 50; },
    • get ACTIONS_PER_TURN () { return 3; },
    • get IRRITATION_MAX () { return 5; },
    • get INTERROGATION_PENALTY () { return 5; },
    • get ACCUSATION_PENALTY () { return 25; },
    • get ACCUSATION_VICTORY () { return 250; },
    •  
    • NUMBER_TURNS: 0, //intended as a const once it's set at the start of the game
    • numSuspects: 0, //this will be randomized 8-16
    • suspectList: [],
    • suspects: [],
    • culprit: {},
    • roomSet: {},
    • rooms: [],
    • player: {},
    • crimeRoom: {},
    • badgeList: []
  • }

We set up several properties and left them blank aside from declaring their variable type by including braces, numbers, or brackets.

Full Cover Art

full cover art

Coding for Kids Books

Build the Room Adventure Game
Build Mini Apps
Build the Catch the Culprit Game

Release Date

August 20, 2022