Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend
A practical and concise introduction to CoffeeScript, a programming language that compiles into JavaScript and that makes working with JavaScript easier. The book lays out the basics of the language, its syntax, and the interesting features that set it apart from JavaScript. It should satisfy anyone with an intermediate level of understanding of JavaScript who needs a conceptual and practical introduction to CoffeeScript.

The book is based around a practical project, leading you through the building of a simple HTML-based 2D game, and explaining the language's philosophy, syntax, and features step-by-step along the way. You'll be able to see results on-screen from the very beginning, starting with a simple JavaScript drawing function transformed into CoffeeScript. The game's code is based on well- understood principles and prior art, using common, simple programming patterns that are easy to grasp while also demonstrating CoffeeScript's expressiveness.

This is a fun and fast-paced book that rewards you for each completed step with interesting game features. You will finish the book with the sense of accomplishment that comes from building something fun, as well as having gained a solid understanding of CoffeeScript and an interest in exploring its more advanced features.

1140203206
Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend
A practical and concise introduction to CoffeeScript, a programming language that compiles into JavaScript and that makes working with JavaScript easier. The book lays out the basics of the language, its syntax, and the interesting features that set it apart from JavaScript. It should satisfy anyone with an intermediate level of understanding of JavaScript who needs a conceptual and practical introduction to CoffeeScript.

The book is based around a practical project, leading you through the building of a simple HTML-based 2D game, and explaining the language's philosophy, syntax, and features step-by-step along the way. You'll be able to see results on-screen from the very beginning, starting with a simple JavaScript drawing function transformed into CoffeeScript. The game's code is based on well- understood principles and prior art, using common, simple programming patterns that are easy to grasp while also demonstrating CoffeeScript's expressiveness.

This is a fun and fast-paced book that rewards you for each completed step with interesting game features. You will finish the book with the sense of accomplishment that comes from building something fun, as well as having gained a solid understanding of CoffeeScript and an interest in exploring its more advanced features.

24.95 In Stock
Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend

Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend

by Earle Castledine
Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend

Jump Start CoffeeScript: Get Up to Speed With CoffeeScript in a Weekend

by Earle Castledine

Paperback

$24.95 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

A practical and concise introduction to CoffeeScript, a programming language that compiles into JavaScript and that makes working with JavaScript easier. The book lays out the basics of the language, its syntax, and the interesting features that set it apart from JavaScript. It should satisfy anyone with an intermediate level of understanding of JavaScript who needs a conceptual and practical introduction to CoffeeScript.

The book is based around a practical project, leading you through the building of a simple HTML-based 2D game, and explaining the language's philosophy, syntax, and features step-by-step along the way. You'll be able to see results on-screen from the very beginning, starting with a simple JavaScript drawing function transformed into CoffeeScript. The game's code is based on well- understood principles and prior art, using common, simple programming patterns that are easy to grasp while also demonstrating CoffeeScript's expressiveness.

This is a fun and fast-paced book that rewards you for each completed step with interesting game features. You will finish the book with the sense of accomplishment that comes from building something fun, as well as having gained a solid understanding of CoffeeScript and an interest in exploring its more advanced features.


Product Details

ISBN-13: 9780987247827
Publisher: SitePoint
Publication date: 12/22/2012
Pages: 164
Product dimensions: 6.50(w) x 10.20(h) x 0.30(d)

About the Author

Sporting a Masters in Information Technology and a lifetime of experience on the "web of hard knocks", Earle Castledine (Mr Speaker) holds an interest in everything to do with computers. A Senior Systems Analyst and JavaScript expert - he is equally happy in the muddy pits of .NET code as in the fluffy fields of client-side interaction development. Co-creator of the client-side opus TurnTubelis, Earle recognizes the Internet not as a lubricant for social change, but as a vehicle for unleashing frivolous ECMAScript gadgets and interesting time-wasting technologies.

Table of Contents

Preface ix

Who Should Read This Book ix

Conventions Used ix

Code Samples ix

Tips, Notes, and Warnings xi

Supplementary Materials xi

Challenge Yourself xii

Friends of SitePoint xii

Chapter 1 Getting Started 1

HTML5 Game Jam Challenge 2

The Basics 3

Missing Cruft 6

Whitespace 6

Comments 7

Types, Variables, and Scope 7

Functions 8

Starting the Game Project 10

Installing: an Overview 10

Client-side Compilation on the Fly 11

Installing CoffeeScript Properly 13

Choosing Our Tech 16

Document Object Model 17

Canvas 18

Further Options 19

Drawing Something: Using Canvas 20

We're on Our Way 22

Chapter 2 CoffeeScript Fundamentals 23

More of the Basics 24

Setting Up Our Project 24

alert versus console.log 25

Returning to JavaScript 27

Strings 27

Conditionals and Operators 28

Loops and Ranges 31

Objects and Arrays 33

Introducing Professor Digman-Rünner 35

The Canvas API 36

Context and Soaking up Nulls 37

Drawing Primitives 40

Draw an Image 42

Processing a Sprite Sheet 43

Random Map 44

Ready to Rumble 46

Chapter 3 Features to Boost Your Game 47

Team Meeting 47

Functions Revisited 48

Default Argument Values 49

Function Gotchas 51

List Comprehensions 53

Creating a Level 55

Building Larger Projects 58

Removing the Safety Wrapper 59

Compiling a List of Files 60

Getting Serious with Cake 61

Handling Player Input 61

Dispatching with Switch 63

Adding the Professor 64

And There Was Light! 66

Chapter 4 Game Loop and Classes 67

The Game Loop 67

Improving Our Loop 68

Looping with RequestAnimationFrame 70

Classes 71

Constructor and Auto Properties 73

Class Inheritance 74

Game Classes 77

The Level Class 77

The Block Class 80

Loading Levels 82

Driving a Level 85

Kicking It All Off 86

Adding New Blocks 88

Stay Classy 90

Chapter 5 Bringing a Game to Life 91

Block Collision Detection 91

Destructured Assignment 1: Arrays 95

Splats 99

Gravity 100

Ladders 103

Collecting 107

Testing Class Types 107

Collision 110

Ninja Al 111

Destructured Assignment 2: Objects 113

Adding the Al Rules into the Code 115

Power to the Professor 117

Digging Holes 117

Building Blocks 119

Set for Life 120

Chapter 6 CoffeeScript and HTML5 FX 121

HTML-ifying things 121

Using jQuery 122

CSS Effects 125

Canvas Scrolling 127

Audio and Sound Effects 128

Animation 130

Walk Animation 131

Falling Animation 132

Screens and Dialogs 133

Particles 141

Game Over 144

Chapter 7 Epilogue 145

And on the Seventh Day 145

Index 147

From the B&N Reads Blog

Customer Reviews