This tutorial series is still under development
TypeScript is one of the most popular programming languages in the world, with a wide range of applications from browsers to servers, many jobs available in the industry, and many other advantages such as outstanding performance and excellent tooling. That all makes it a great choice for starting to learn how to code. This tutorial series will help teach you the beginnings of the TypeScript programming language in Construct!
This tutorial is aimed at beginners. If you already know TypeScript, check out the Construct for TypeScript developers quick start guide.
If you'd prefer to start learning JavaScript instead, see our other guide Learn JavaScript in Construct.
TypeScript vs. JavaScript
TypeScript is very closely related to JavaScript. TypeScript is in fact an extension to JavaScript. It supports pretty much everything JavaScript does, and then it adds extra features on top. Therefore you'll essentially also be learning JavaScript along the way. In many cases resources for JavaScript will also be useful when working with TypeScript.
We haven't dug in to how either programming language works yet, but in brief, what TypeScript does is add static types to JavaScript. JavaScript is a dynamic programming language which allows changing data types, like replacing a number with some text. TypeScript enforces data types to disallow things like that. The type system is comprehensive and sophisticated, covering a wide range of programming features. These static types can help catch possible coding mistakes earlier, and also provides better tooling, such as exact autocomplete when writing code. For these reasons we'd recommend that TypeScript is a better option for beginners, even though there is a little more to learn to get started.
JavaScript is not Java
One common point of confusion to clear up right away is that Java and JavaScript are two completely different programming languages! The naming is indeed somewhat confusing, but try not to get the two mixed up. As TypeScript and JavaScript are closely related, you may still want to look up information about JavaScript. So if you search the web for something to do with JavaScript, be sure to specifically search for JavaScript and not Java, otherwise you will get results for the wrong programming language!
About this guide
This guide will help you learn the TypeScript programming language using Construct's TypeScript coding feature. This is a good way to get started as you can just start writing code right away without having to set up a development environment (such as a local HTTP server). The entire tutorial series is designed to work within the limits of the free edition, so you can learn TypeScript with this guide without having to purchase anything. Construct's TypeScript coding feature also provides lots of ways to do more in your projects, so is a useful thing for more advanced Construct users to learn as well.
Construct uses the standard TypeScript programming language so you're learning exactly the same thing as is used everywhere else in the industry. Construct does not alter the language in any way.
Construct's block-based system in event sheets is designed to be easier for beginners to get started with. If you want to try getting started with blocks, or just gain some familiarity with Construct first, consider trying the Beginner's guide to Construct.
You don't have to have used Construct before to follow this guide. However some familiarity will be useful. If you are also familiar with variables, loops and functions in event sheets, this will also be helpful. These features of event sheets are intentionally designed to be similar to how the equivalent programming language features work. So if you know how they work in event sheets, this will help give you a head start in understanding how they work in TypeScript. This guide will note where event sheets have similar concepts to TypeScript. These references won't be essential to following the guide though, it's just extra context for Construct users who are already familiar with event sheets.
What you'll learn
This guide will cover the basic features of the TypeScript programming language, covering topics like variables, 'if' statements, loops and functions. TypeScript is a mature language with a huge range of features, and this guide does not attempt to cover it in its entirety. The goal is to teach you enough TypeScript that you can learn from other guides across the web and know how to apply it in Construct. (Some additional guides will be linked at the end of the series.)
TypeScript is based on JavaScript, which was invented in 1995, and like most old programming languages, JavaScript has its fair share of quirks and legacy features. However this guide will focus on the most useful parts using a modern style with best practices, and avoid going in to detail about quirks or old features that are no longer widely used. In other words, this is a practical guide focused on writing real-world code.
Ready to get started? Head to the next page to write your first line of code!