react-native-game-engine icon indicating copy to clipboard operation
react-native-game-engine copied to clipboard

is there anyone who is maintaining this library yet?

Open dilo99 opened this issue 2 years ago • 2 comments
trafficstars

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

dilo99 avatar Aug 09 '23 20:08 dilo99

same

LinhLM23496 avatar Aug 20 '23 12:08 LinhLM23496

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

M-Jeremy avatar Sep 01 '23 13:09 M-Jeremy