code clean-up
This commit is contained in:
parent
e66166c30c
commit
d1fb6871ef
|
@ -1,26 +0,0 @@
|
|||
import React, { PureComponent } from "react";
|
||||
import { StyleSheet, View } from "react-native";
|
||||
|
||||
const RADIUS = 20;
|
||||
|
||||
export const Finger = ({ position }: { position: any[] }) => {
|
||||
const x = position[0] - RADIUS / 2;
|
||||
const y = position[1] - RADIUS / 2;
|
||||
return (
|
||||
<View style={[styles.finger, { left: x, top: y }]} />
|
||||
)
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
finger: {
|
||||
borderColor: "#CCC",
|
||||
borderWidth: 4,
|
||||
borderRadius: RADIUS * 2,
|
||||
width: RADIUS * 2,
|
||||
height: RADIUS * 2,
|
||||
backgroundColor: "pink",
|
||||
position: "absolute"
|
||||
}
|
||||
});
|
||||
|
||||
export default Finger;
|
|
@ -27,13 +27,6 @@ export const entities = (restart: boolean = false) => {
|
|||
|
||||
let entities = {
|
||||
physics: { engine, world },
|
||||
// fingers: {
|
||||
// 1: { position: [40, 200], renderer: Finger },
|
||||
// 2: { position: [100, 200], renderer: Finger },
|
||||
// 3: { position: [160, 200], renderer: Finger },
|
||||
// 4: { position: [220, 200], renderer: Finger },
|
||||
// 5: { position: [280, 200], renderer: Finger },
|
||||
// },
|
||||
Balloon: newBalloon(),
|
||||
LeftWall: Wall(
|
||||
world,
|
||||
|
|
|
@ -3,12 +3,10 @@ import Matter from "matter-js";
|
|||
|
||||
export { windowHeight, windowWidth } from "@game";
|
||||
|
||||
import Finger from "./Finger";
|
||||
import Wall from "./Wall";
|
||||
import Balloon from './Balloon';
|
||||
|
||||
export {
|
||||
Finger,
|
||||
Wall,
|
||||
Balloon
|
||||
};
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"react-dom": "17.0.2",
|
||||
"react-native": "0.68.2",
|
||||
"react-native-game-engine": "^1.2.0",
|
||||
"react-native-reanimated": "~2.8.0",
|
||||
"react-native-safe-area-context": "4.2.4",
|
||||
"react-native-svg": "12.3.0",
|
||||
"react-native-web": "0.17.7"
|
||||
|
|
Loading…
Reference in New Issue