Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

JavaScript Projects for Kids
JavaScript Projects for Kids
JavaScript Projects for Kids
Ebook326 pages2 hours

JavaScript Projects for Kids

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Gear up for a roller-coaster ride into the world of JavaScript and programming with this easy-to-follow, fun, and entertaining project-based guide

About This Book

- 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

Who This Book Is For

If you've never written code before or you are completely new to the world of web programming, then this book is the right choice for you. This book is for kids of age 10 years and above and parents who are completely new to the world of programming and want to get introduced to programming.

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

In Detail

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.

Style and approach

This is an easy-to-follow, informative, and fun guide that takes a project-based approach to teaching programming in JavaScript. You will learn everything you need to get started with serious web application development.
LanguageEnglish
Release dateJan 30, 2016
ISBN9781783988495
JavaScript Projects for Kids

Related to JavaScript Projects for Kids

Related ebooks

Internet & Web For You

View More

Related articles

Reviews for JavaScript Projects for Kids

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    JavaScript Projects for Kids - FarukTowaha Syed Omar

    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


    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

    Credits

    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

    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.

    I wish to take the opportunity to thank the staff at Packt Publishing for their commitment and hard work, especially Sachin Karnani (Content Development Editor), Aaron Lazar (Acquisition Editor), and Nikhil Nair (Project Coordinator). They got numerous reviews, kept the book on track, and helped me in many ways. I really appreciate their input. I also wish to thank Johnathan Iannotti (Reviewer) for his constructive criticism and helpful comments.

    About the Reviewer

    Johnathan Iannotti is a software engineer and geek on an epic journey of life. His experience spans 15 years of technology solutions for start-ups, financial companies, healthcare, and military. He is passionate about web technology and has been creating hybrid apps since their inception. A full-stack developer by trade, he loves UX/UI, frontend development, and mobile.

    He works for USAA, creating mobile applications for over 27,000 employees that serve their military membership. He is also a combat veteran having served almost a decade in the United States Army.

    Johnathan spends his time innovating, coding, and making the best of it all. When he's not plugged in, he spends as much time as he can with his beautiful wife and two children who make it all possible. <3

    Follow Johnathan on Twitter at @notticode or visit his website at http://johnforhire.com/.

    www.PacktPub.com

    Support files, eBooks, discount offers, and more

    For support files and downloads related to your book, please visit www.PacktPub.com.

    Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.

    At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

    https://www2.packtpub.com/books/subscription/packtlib

    Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

    Why subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print, and bookmark content

    On demand and accessible via a web browser

    Free access for Packt account holders

    If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

    Preface

    As you can guess from the title of the book, this book is designed and set up for kids so that they can teach themselves JavaScript and create some projects using JavaScript.

    By abstracting the core web programming in an unparalleled way, JavaScript changed websites and web apps forever. Boring static websites and non-interactive websites have now become quite awesome with the touch of JavaScript. Using JavaScript, you can develop web applications, even smartphone applications too, quickly without compromising quality. You can be very productive and deal with almost no configuration on your hardware and software if you start playing with JavaScript. Please remember that this is not a reference book, but you can learn every basic concepts of JavaScript from it. So, for the kids aged 10 and above, this will be a perfect book to discover the world of JavaScript.

    What this book covers

    Chapter 1, Exploring JavaScript in the Console, discusses JavaScript and the JavaScript Development Environment, including Google Developer Tools. We will install the necessary software and print a few simple lines of code in this chapter.

    Chapter 2, Solving Problems Using JavaScript, covers JavaScript fundamentals from the main syntax to some easy commands in the console. We will learn how variables work and what can be achieved with arithmetic operators. We will also run some simple commands to solve problems inside the console.

    Chapter 3, Introducing HTML and CSS, will make real use of JavaScript and will cover HTML, which empowers the readers to make use of JavaScript not only in the console but also in the browser's view. We will also explain the basics of CSS, such as CSS selectors, and CSS layouts.

    Chapter 4, Diving a Bit Deeper, covers some of the more advanced features that JavaScript offers. We discuss for and while loops, if statements, and switches-case.

    Chapter 5, Ahoy! Sailing into Battle, teaches us how to develop the famous game, Battleship. Building upon what we've learned in the previous chapters, the tiny tots will learn to put this information into use.

    Chapter 6, Exploring the Benefits of jQuery, is all about jQuery, a famous JavaScript library, and the advantages of using it.

    Chapter 7, Introducing the Canvas, discusses HTML canvas, and we will learn how we can use it on our projects.

    Chapter 8, Building Rat-man!, teaches us to develop a famous game, Pac-Man, except there is a rat, some cats, and lots and lots of cheese balls to eat! ;)

    Chapter 9, Tidying up Your Code Using OOP, teaches object-oriented programming (OOP) and discusses how JavaScript is an OOP language.

    Chapter 10, Possibilities, shows the reader what is possible using the skills they have developed reading this book.

    What you need for this book

    Throughout this book, we have used Google Chrome as our browser to run our JavaScript code on the console.

    Enjoying the preview?
    Page 1 of 1