JavaScript Projects for Kids
Language: English
Pages: 188
ISBN: 1785287176
Format: PDF / Kindle (mobi) / ePub
Key Features
- Get to know the concepts of HTML and CSS to work with JavaScript
- Explore the concepts of object-oriented programming
- Follow this step-by-step guide on the fundamentals of JavaScript programming
Book Description
JavaScript is the most widely-used programming language for web development and that's not all! It has evolved over the years and is now being implemented in an array of environments from websites to robotics. Learning JavaScript will help you see the broader picture of web development.
This book will take your imagination to new heights by teaching you how to work with JavaScript from scratch. It will introduce you to HTML and CSS to enhance the appearance of your applications. You'll then use your skills to build on a cool Battleship game! From there, the book will introduce you to jQuery and show you how you can manipulate the DOM. You'll get to play with some cool stuff using Canvas and will learn how to make use of Canvas to build a game on the lines of Pacman, only a whole lot cooler! Finally, it will show you a few tricks with OOP to make your code clean and will end with a few road maps on areas you can explore further.
What you will learn
- Learn how to work with Google Developer tools to iterate, debug and profile your code
- Develop a Battleship game using the basic concepts of HTML and CSS
- Get to know the fundamentals of JavaScript programming
- Create our own version of Pac Man game.
- Discover the vital concepts of object-oriented programming
About the Author
Syed Omar Faruk Towaha has degrees in physics and computer engineering. He is a technologist, tech speaker, and physics lover from Shahjalal University of Science and Technology (SUST), Sylhet. He has a passion for programming, tech writing, and physics experiments.
His recent books include Easy Circuits for Kids, Fundamentals of Ruby, and How You Should Design Algorithms. He is an Oracle-certified professional developer currently involved with a number of projects that serve both physics and computer architecture.
He is the president of one of the largest astronomical organizations (Copernicus Astronomical Memorial of SUST (CAM-SUST)) in Bangladesh. He also volunteers for Mozilla as a representative.
Table of Contents
- Exploring JavaScript in the Console
- Solving Problems Using JavaScript
- Introducing HTML and CSS
- Diving a Bit Deeper
- Ahoy! Sailing into Battle
- Exploring the Benefits of jQuery
- Introducing the Canvas
- Building Rat-man!
- Tidying up Your Code Using OOP
- Possibilities
Learning Unix for OS X: Going Deep with the Terminal and Shell (2nd Edition)
UNIX Operating System: The Development Tutorial via UNIX Kernel Services
Cognitive Networked Sensing and Big Data
Electronic Value Exchange: Origins of the VISA Electronic Payment System (History of Computing)
explain the code later:
Click Here!
After opening the HTML file, click on Click Here! You will see the following screen: It means your jQuery is working. Let's discuss the code
interface and the game's functionalities, we will be needing JavaScript. We will need the following JavaScript files in the scripts folder: app.main.jsapp.display_functions.jsapp.init.jsapp.key_handler.jsapp.movement_functions.jsapp.constants.js The app.main.js file Our app.main.js file should contain the following function that will deal with the app.key_handler.js file and your computer's keyboard. It will also call the app.init.js file for the initialization of our variables. Note Here we
this.right = true; this.left = false; } else { this.direction = APP.Direction.STOP; } } if (this.down) { if (APP.map.marks[this.y + 1][this.x] !== APP.WALL_MARK) { this.up = false; this.down = true; this.right = false; this.left = false; } else { this.direction = APP.Direction.STOP; } } if (this.left) { if (APP.map.marks[this.y][this.x - 1] !== APP.WALL_MARK) { this.up = false; this.down = false; this.right = false; this.left = true; } else { this.direction = APP.Direction.STOP; } } }; The
for, while, if, switch, case, and so on) are always in lowercase. The build-in objects (such as Date, Math, Number, and so on) start with uppercase. Variables We already know that the computer world has nothing but data. There are different types of data (we call them data types), as follows: Your name is a kind of dataYour age is dataYour grade is also data Yet, they all are different. What is the difference between them? Your name only contains a group of characters or, as some people also
does the website contain? A few web pages? You may see some text, few images, one or two text fields, buttons, and some more elements on each of the web pages. Each of these elements are formatted by HTML. Let me introduce you to a web page. On your Internet browser, go to https://www.google.com. You will see a page as shown in the following image: The first thing you will see on the top of your browser is the title of the webpage. Let's observe the page that we just loaded: Here, the marked