Open x5engine opened 5 years ago
Has anyone been able to solve this?
@HadrienRivere @x5engine
Sorry dudes, not sure how I missed this issue! First time I'm seeing it.
I used the template over the weekend on NodeJS 8.9.4 and NPM 6.9.0, it worked fine.
Can I get the following details of you guys:
@HadrienRivere @x5engine
Sorry dudes, not sure how I missed this issue! First time I'm seeing it.
I used the template over the weekend on NodeJS 8.9.4 and NPM 6.9.0, it worked fine.
Can I get the following details of you guys:
- NodeJS, NPM
- OS
- Expo version
- Simulator + details
- Device + details
- DId you make any changes to the template or are you basically running it after cloning?
Hello, thanks for answering.
Here is more details about the problem:
Node Version: v12.8.1 Npm Version: 6.10.2 Os; Windows Expo version: 3.11.3 Simulator : N/A Device: Motorola e5 plus, Basically when we run the npm start and wait for the program to be compiled, the screen in the divice goes dark and on the console throws the message described above. DId you make any changes to the template or are you basically running it after cloning? No.
just wait another 4 months for a response
Hi @HadrienRivere,
Can you replace game/index.js
with:
import React from "react";
import { View } from "react-native";
import { GameEngine } from "react-native-game-engine";
const sys = entities => entities;
function Circle() {
return <View style={{ backgroundColor: "red", width: 50, height: 50, borderRadius: 50, left: 100, top: 100 }} />
}
class Game extends React.Component {
render() {
return (
<GameEngine
style={{ backgroundColor: "black" }}
systems={[sys]}
entities={{
test: { renderer: Circle }
}}
/>
);
}
}
export default Game;
I just want to see if anything shows up on the screen. I suspect its a permission thing with downloding .fbx files, or perhaps expo isn't packaging them properly or at all.
I'll hop on my Windows machine after work and give it a shot.
Hi @HadrienRivere,
Can you replace game/index.js with:
import React from "react"; import { View } from "react-native"; import { GameEngine } from "react-native-game-engine"; const sys = entities => entities; function Circle() { return <View style={{ backgroundColor: "red", width: 50, height: 50, borderRadius: 50, left: 100, top: 100 }} /> } class Game extends React.Component { render() { return ( <GameEngine style={{ backgroundColor: "black" }} systems={[sys]} entities={{ test: { renderer: Circle } }} /> ); } } export default Game;
I just want to see if anything shows up on the screen. I suspect its a permission thing with downloding .fbx files, or perhaps expo isn't packaging them properly or at all.
I'll hop on my Windows machine after work and give it a shot.
Hi. Now I have the following.
Console:
Okay, it must be something with .fbx extension. I wouldn't be surprised if the .glb extension also didn't work.. Can you undo what we did abouve ^^ and replace game/entities.js
with the following:
import { THREE } from 'expo-three';
import Camera from "./components/camera";
import Cuphead from "./components/cuphead";
import HUD from "./components/hud";
import Turntable from "./components/turntable";
//import Droid from "./components/droid";
import Portal from "./components/portal";
//import Jet from "./components/jet";
import { clear } from "./utils/three";
import * as OIMO from "oimo";
const scene = new THREE.Scene();
const camera = Camera();
const world = new OIMO.World({
timestep: 1 / 60,
iterations: 8,
broadphase: 2,
worldscale: 1,
random: true,
info: false,
gravity: [0, -9.8 ,0]
});
export default async () => {
clear(scene);
world.clear();
const ambient = new THREE.AmbientLight(0xffffff, 1);
const sunlight = new THREE.DirectionalLight(0xffffff, 0.95);
sunlight.position.set(50, 50, 50);
scene.add(ambient);
scene.add(sunlight);
camera.position.set(0, 2, 6);
camera.lookAt(new THREE.Vector3(0, 0, 0));
const cuphead = await Cuphead({ y: 1 });
//const droid = await Droid({ y: 1 });
const portal = await Portal({ y: 1 });
//const jet = await Jet({ y: 1 });
const turntable = Turntable({ parent: scene, world, items: [cuphead, portal] });
const hud = HUD();
const entities = {
scene,
camera,
world,
//droid,
cuphead,
portal,
//jet,
turntable,
hud
}
return entities;
};
Okay, it must be something with .fbx extension. I wouldn't be surprised if the .glb extension also didn't work.. Can you undo what we did abouve ^^ and replace
game/entities.js
with the following:import { THREE } from 'expo-three'; import Camera from "./components/camera"; import Cuphead from "./components/cuphead"; import HUD from "./components/hud"; import Turntable from "./components/turntable"; //import Droid from "./components/droid"; import Portal from "./components/portal"; //import Jet from "./components/jet"; import { clear } from "./utils/three"; import * as OIMO from "oimo"; const scene = new THREE.Scene(); const camera = Camera(); const world = new OIMO.World({ timestep: 1 / 60, iterations: 8, broadphase: 2, worldscale: 1, random: true, info: false, gravity: [0, -9.8 ,0] }); export default async () => { clear(scene); world.clear(); const ambient = new THREE.AmbientLight(0xffffff, 1); const sunlight = new THREE.DirectionalLight(0xffffff, 0.95); sunlight.position.set(50, 50, 50); scene.add(ambient); scene.add(sunlight); camera.position.set(0, 2, 6); camera.lookAt(new THREE.Vector3(0, 0, 0)); const cuphead = await Cuphead({ y: 1 }); //const droid = await Droid({ y: 1 }); const portal = await Portal({ y: 1 }); //const jet = await Jet({ y: 1 }); const turntable = Turntable({ parent: scene, world, items: [cuphead, portal] }); const hud = HUD(); const entities = { scene, camera, world, //droid, cuphead, portal, //jet, turntable, hud } return entities; };
Hi. good morning.
It seems that now everything is going right. now it clearly loads the game. there is only one detail, the cuphead entity is static. it moves under its axis but that does not advance beyond where it is generated.
console:
Hi @HadrienRivere,
When you swivel the "touch stick" on the left, Cuphead should cyle through some sprite animations. Is that working? If you hit the "a" or "b" buttons some boxes and cylinders will fall from the sky.
Other than that, that's about all it does.. I use this repo as a starter for working with the React Native Game Engine library. It contains a bunch of systems and renderering effects that may be useful to others. But it definitely isn't a playable game.
Cheers.
bug when I start the app