This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import { StyleSheet, Image } from "react-native"; | |
import { collisionCategories } from "./constants"; | |
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource'; | |
import Matter from "matter-js"; | |
import MarioIdling from "./mario-idling.gif"; | |
export class Renderer extends Component { | |
render() { | |
const source = this.props.actions[this.props.action]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from "react"; | |
import { StyleSheet, StatusBar } from "react-native"; | |
import { GameEngine } from "react-native-game-engine"; | |
import { LevelOne } from "./entities"; | |
export default class App extends PureComponent { | |
constructor(props) { | |
super(props); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from "react"; | |
import Matter from "matter-js"; | |
import PlatformImage from "./platform.png"; //-- You can get the images from our repo. | |
import Tile from "./tile"; //-- This is just a helper component | |
import { collisionCategories } from "./constants"; | |
export class Renderer extends PureComponent { | |
render() { | |
return ( | |
<Tile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Dimensions } from "react-native"; | |
import Matter from "matter-js"; | |
import Platform from "./platform"; | |
import Mario from "./mario"; | |
//-- Overriding this function because the original references HTMLElement | |
//-- which will throw an error when running in a React Native context | |
Matter.Common.isElement = () => false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from "react"; | |
import { StyleSheet } from "react-native"; | |
import ReglView from "./ReglView"; | |
import mat4 from "gl-mat4"; | |
import bunny from "bunny"; | |
export default class Bunny extends PureComponent { | |
drawCommand = regl => { | |
return regl({ | |
vert: ` |
NewerOlder