Using the getElementsByClassName() method in JavaScript
The getElementsByClassName() method returns an array of elements in a document that have a class name of a value we specify when using the method. It can be used to manipulate more than one …
The getElementsByClassName() method returns an array of elements in a document that have a class name of a value we specify when using the method. It can be used to manipulate more than one …
In this activity, we will use a soil moisture sensor to keep track of the amount of water in the soil surrounding plants so we can know when the soil …
Servo motors are motors that can be used to rotate parts of machines with precision. Small servo motors can be directly connected to an Arduino microcontroller board to control the position of …
LEDs can be switched between HIGH (on) and LOW (off) states when they are connected to the Arduino’s digital pins. However, digital output can only be in either of two …
In this tutorial, you will learn how to connect an ultrasonic sensor (HC-SR04) to an Arduino. An Ultrasonic Sensor is used to measure distance. It emits ultrasound at 40,000 Hz (40kHz) which travels through the …
In this tutorial, we will use a push-button (switch) to turn an LED light on and off. You will need the following: Arduino Uno microcontroller board Breadboard LED light Push …
This tutorial explains how to use the following array methods in JavaScript: push() to append elements to the end of an array pop() to remove the last element from an array …
This tutorial explains how to call functions from an event on a web page using HTML and JavaScript code. In the examples in the video, a function written in JavaScript …
This tutorial explains how to add a second level to a game in WoofJS, as shown in the example below. To implement a second level in your game, use the …
This tutorial explains how to add a high score to a game in WoofJS, as shown in the example below. To add a high score, we will need to use …
This tutorial explains how to flip a player sprite to look in each direction when walking left or right (in WoofJS), as shown below. To achieve this, we just change the …
This tutorial explains how to change the backdrop colour of a game in WoofJS (so you can use a colour instead of an image for the backdrop). Create a new …
This tutorial explains how to make an enemy (or any object) follow the player (or another object) around in WoofJS, as shown in the example below. Create a project in …
This tutorial explains how to make an object (such as an image, shape, or text) follow the movement of the mouse, as shown in the example below. Create a project …
This tutorial explains how to make an enemy patrol or move around randomly on its own in WoofJS, as shown below. Create a new project at woofjs.com and use the …