bberak/react-native-game-engine

is there anyone who is maintaining this library yet?

dilo99 opened this issue · 2 comments

dilo99 commented

Currently this library, in my opinion, is unusable with the latest versions of React Native. the fact that the example codes still use the classes and not the React functions already shows how old this library is. but then in the example codes no typescript is even used...
so I'm wondering, is there anyone maintaining this library, which everyone says is great, but as of today is unusable, is there?
Has anyone been able to use it with the latest versions of React Native and Typescript lately?
if yes can you share me a piece of code or an example project, because currently all the example codes on this official documentation don't work.
Thank you

same

Still working with the quick start example (minimal example, JS), last RN & Expo version with react functions

  1. npx create-expo-app my-app
  2. Install RNGE
  3. Do the quick start example
  4. "Final" code :
import { StatusBar } from 'expo-status-bar'; 
import { StyleSheet, AppRegistry } from 'react-native';
import { GameEngine } from "react-native-game-engine";
import { Finger } from "./renderers";
import { MoveFinger } from "./systems";

export default function App(){
  return (
    <GameEngine
      style={styles.container}
      systems={[MoveFinger]}
      entities={{
        1: { position: [40, 200], renderer: <Finger /> }, //-- Notice that each entity has a unique id (required)
        2: { position: [100, 200], renderer: <Finger /> }, //-- and a renderer property (optional). If no renderer
        3: { position: [160, 200], renderer: <Finger /> }, //-- is supplied with the entity - it won't get displayed.
        4: { position: [220, 200], renderer: <Finger /> },
        5: { position: [280, 200], renderer: <Finger /> }
      }}>

      <StatusBar hidden={true} />

    </GameEngine>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
  },
});

AppRegistry.registerComponent("App", () => App);
  1. Start dev server
  2. Tested on iOS device with Expo Go