Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

TIC-80

Fantasy computer for making, playing and sharing tiny games. · By Nesbox

Javascript Version/Features Supported?

A topic by beermidwest created Dec 03, 2020 Views: 943 Replies: 4
Viewing posts 1 to 5

I'm really loving TIC-80, primarily because I can use a more full-featured language like Javascript. But what the heck version is the interpreter using? I've been working on a couple games (using Javascript), and running into a lot of issues trying to figure out what is supported. I have to use the older style definitions for Javascript classes (not using ES2015 "class" structure), and the for/of loops (iterating values in an object or array, without using basic numeric-style for loops) just flat out don't exist.

I wanted to like Pico-8 but the limitations and having to "dumb-down" my code when the conveniences of Object-oriented programming are too great. I love that I can use "real" objects with static properties, methods, and inheritance. Pico-8 might be a good "learning to program" tool, but TIC-80 seems like a better tool as a stepping stone to REAL game development since it supports languages other than Lua where more modern conventions can be used.

Developer

Hi,

we are using https://duktape.org/ for JS in TIC-80

If you want to use a modern syntax, try using Typescript, but setting the compile target to es5.

Just to be clear, though, internally es2015 classes are no different than es5 prototypes. The source code looks different, but it is just 'syntactic sugar' for achieving the exact same thing at runtime.

Looking into Typescript, I wasn't familiar with it. Bringing modern coding transpiled back to ES5? I love it. Thank you! I understand it's just "syntactic sugar," but I'd rather spend my time coding/testing/debugging rather than always having to research and remember the weird way to add static class properties and methods using JS's weird prototype syntax conventions.

No problem. There are a few things that can't be transpiled or polyfilled because they have to be supported at the engine level (Proxy, import statements, et. al.), but they shouldn't be a huge problem.