Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I build 3D or 2D interactive games using React Native?

Tags:

React runs a JS V8 engine to build the UI in Native. It can obviously hook into the OpenGL native library but can we actually build performant Games using React Native?

like image 669
Sanket Sahu Avatar asked Sep 18 '15 13:09

Sanket Sahu


People also ask

Can I use React Native for game development?

I will prove to you that React Native is great for making games, depending on your choice of games and expertise with the library.

Is React Native game engine good?

As mentioned previously, React Native Game Engine has very little support, so you'll be able to make a small game or prototype, but you won't get very far with graphics. There are better alternatives like using Unity to develop a game mobile app and connect with React Native.

Is React Native good for mobile games?

Yes ReactNative is a good idea for mobile app development. React Native is a JavaScript framework for iOS and android mobile applications, created with the web technology inbuilt in mobile apps for maintaining high performance. React Native is useful in building cross platform mobile applications.

Can games be made with react?

Yes, Reactjs gives you quick rendering and awesome user experience. You can take an advantage of this to create games.


2 Answers

Yes, it can be done and the performance looks pretty neat.

Here is a video which demonstrate the same for iOS: A Quick React Native Demo with OpenGL

OpenGL for Android can also be hooked up in a similar way.

like image 135
Sanket Sahu Avatar answered Nov 02 '22 23:11

Sanket Sahu


It really depends on what type of game you're going to build. I rebuilt my nonogram puzzle game from Obj-C to React Native, and after putting effort into optimization (eliminating redundant renders, using fewer components, and using the Animated API wherever possible), the performance in RN was just a good as Obj-C.

However, this is a 2D puzzle game that doesn't use any sort of fancy rendering--it is just a grid with numbers and a few simple animations. I will also note that I did have to write the grid itself in native code, as it would generate up to 625 RN Views (for a 25x25) puzzle and that just killed performance when it rendered.

In conclusion, RN it without any external libraries is fine for simpler 2D games like puzzles, but I'd hesitate to use it for anything like a platformer, action or 3D game--it's just not made for that.

like image 31
Arman Avatar answered Nov 03 '22 01:11

Arman