Can Javascript family be used in Augmented reality

can languages like javascript and java and others in the same family be used in developing a game like pokemon go or ingress?

Javascript and Java are extremely different. I think that Pokémon Go was written using Unity, so that would be C#, which is completely different than Java and Javascript.

1 Like

You certainly could create augmented reality applications using JavaScript, but it’s probably not the best tool for the job.

2 Likes

can you elaborate on that?

It’s not designed to handle computationally intensive tasks, like graphics. It has APIs to handle this in the browser, but you do not want heavy computation in the browser. You normally use a language that allows you to control how memory is used: JavaScript itself does not allow this.

You’re unlikely to be able to get anything close to the performance level of PG (and PGs performance isn’t great anyway, so you’re likely going to be a long way off). And performance is really important here.

This being said, you can use available browser APIs for cameras, geospatial position, AR etc, and there are libraries to help with that, for example:

  • AR.js, which uses A-Frame for VR, which can then make use of cameras etc to provide AR and a 3D library to build 3D components based on that
  • Argon.js which doesn’t use A-Frame, I assume it’s using its own implementation based on the browser APIs

I’ve never used anything except A-Frame (and even that was just playing around with it for a few days), so I can’t vouch for how good they are, but you should definitely be able to get some nice results. AR.js I think is most complete and has the most support, so I’d probably start there.

Note that these are designed for small pieces of interactivity on websites, not games, where everything I said above applies. The more you try to make them do, the more performance will suffer. There is a huge heavyweight thing that needs enormous amounts of processing power itself (a browser) and via which all your code has to be piped sitting in-between the code and the device hardware. Whereas with a game running on a system (eg PG), there isn’t.

But they should let you play around and build prototypes at least.

2 Likes

what languages do you recommend then, to build games to play on phones with cameras that allow AR.

Well I’d just say use what I advised? You aren’t going to be able to make anything like as complicated as Pokémon Go, why not just build some things using the browser?

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.