![]()
JavaScript Projects for Kids
Table of Contents
JavaScript Projects for Kids
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Exploring JavaScript in the Console
Installing Google Chrome
Installing Atom
Chrome Developer Tools
Our first program
Why do we use Chrome Developer Tools?
Why do we use Atom as the text editor?
Exercise
Summary
2. Solving Problems Using JavaScript
Variables
Comments
Arithmetic operators
Addition
Subtraction
Multiplication
Division
Modulus
More operators and operations
Increment or decrement operators
Assignment operators
JavaScript comparison and logical operators
Summary
3. Introducing HTML and CSS
HTML
Your first webpage
More HTML tags
Coloring HTML text
Linking HTML text
Inserting an image
CSS
JavaScript on an HTML page
Summary
4. Diving a Bit Deeper
JavaScript methods
HTML buttons and form
Buttons
Form
If statement
Switch-case
Exercise
Loops
The for loop
Exercise
The while loop
Exercise
Summary
5. Ahoy! Sailing into Battle
The HTML part
The CSS part
The JavaScript part
The final code
Summary
6. Exploring the Benefits of jQuery
Installing jQuery
Explaining the code
Going deeper
The load() method
The keyup() and keydown() methods
The change() method
The blur() and focus() methods
The resize() method
The scroll() method
Summary
7. Introducing the Canvas
Implementing canvas
Adding JavaScript
Drawing a rectangle
Drawing a line
A quick exercise
Drawing a circle
Draw linear gradient
A quick exercise
Let's make a clock!
Summary
8. Building Rat-man!
Game user interface
Adding functionalities to the game
The app.main.js file
The app.display_functions.js file
The app.init.js file
Images for Rat-man!
The monsters folder
The player folder
The portal folder
The walls folder
Adding images to our cats
Draw the canvas
The app.key_handler.js file
The app.movement_functions.js file
The app.constants.js file
Playing the game
Summary
9. Tidying up Your Code Using OOP
Inheritance in JavaScript
Encapsulation in JavaScript
Dissecting Hangman
Summary
10. Possibilities
JavaScript as your first programming language
JavaScript is everywhere
JavaScript developer as profession
All chores can be done by JavaScript
Robotics
3D games
Making apps for your smartphones
Running web servers
Running Ruby and Python
Writing OS-independent desktop applications
Web scraping and screenshotting
Web analytics
Responsive and interactive contents
Animation
Creating cookies
Awesome JavaScript examples
Summary
Index
![]()
JavaScript Projects for Kids
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2016
Production reference: 1220116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-717-6
www.packtpub.com
![]()
Author
Syed Omar Faruk Towaha
Reviewer
Johnathan Iannotti
Commissioning Editor
Veena Pagare
Acquisition Editor
Aaron Lazar
Content Development Editor
Sachin Karnani
Technical Editor
Manthan Raja
Copy Editor
Vibha Shukla
Project Coordinator
Nikhil Nair
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Graphics
Disha Haria
Jason Monteiro
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
![]()
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 i...