GithubHelp home page GithubHelp logo

jaredly / gravitron Goto Github PK

View Code? Open in Web Editor NEW
488.0 13.0 18.0 19.46 MB

a little game

Home Page: https://gravitron.jaredforsyth.com

OCaml 95.00% C++ 0.15% JavaScript 0.13% Shell 2.12% Java 0.14% Objective-C 2.47%

gravitron's Introduction

Gravitron

this is a little game I'm cooking up, written in Reason, using Reprocessing (a cross-platform opengl-backed 2d-graphics library).

Try it out at http://gravitron.jaredforsyth.com/, and tell me what you think!

Download the osx native version from the releases page.

gameplay

Building (currently broken ๐Ÿ™ƒ, working on a more general solution)

git submodule update --init --recursive
yarn

Web

(assuming you have http-server installed, via yarn global add http-server)

npm run js && npm run js:serve

Then open your browser to http://localhost:3121

If you don't have http-server, you can run npm run js and start your favorite webserver in the docs directory.

Native macOS

(development)

npm run build
npm start

(release, make a mac app)

npm run build:native
cd bundler && ./bundle.sh

Now you've got a mac app in ./bundler/Gravitron.app.

Android

NOTE: You must have opam setup for this to work. ALSO NOTE: Ocaml currently produces binaries that have "text relocations", which android is unhappy about. So you'll get a popup in the dev build, but it doesn't show in the release build.

./reasongl-android/setup_opam.sh # this is idempotent
npm run build:android

If you also want to install the debug apk to a simulator or device, do npm run run:android.

iOS

NOTE: You must have opam setup for this to work.

./reasongl-ios/setup_opam.sh # this is idempotent
npm run build:ios

Then open the project ./ios/OcamlIOS.xcodeproj in Xcode, and you should be able to build & run.

Contributing

Android

Some good resources

License

This code is licensed under Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0). If you use this code, you must attribute me (Jared Forsyth), and link back to this repository. If you want me to license parts of the codebase under a more permissive license, such as one that allows commercial use, you're welcome to ask.

gravitron's People

Contributors

jaredly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gravitron's Issues

A few questions.

Hello! I was looking through the code to refresh myself on Reason, and had a couple questions on your code:

  1. Why did you chose to use polymorphic variants here? https://github.com/jaredly/gravitron/blob/master/src/Main.re#L90-L121

  2. screenable is a GADT, right? I see that it's being used as a kind of container, and its constructor values are being pulled out in other places in the code. Why use a GADT instead of a record or something?
    https://github.com/jaredly/gravitron/blob/master/src/ScreenManager.re#L17-L18

Thanks for your time if you're able to help =) Just curious..

currently not able to install at tip of master - OS X 10.12.5

At the tip of the master branch (8d5479a), I found that build.ninja had a reference to windows paths for bsc and refmt. By chance is master waiting for an additional piece such as your PR for reasongl-ios to matchenv?

$ yarn install
yarn install v1.3.2
warning package.json: License should be a valid SPDX license expression
warning [email protected]: License should be a valid SPDX license expression
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
warning Pattern ["bs-platform@bsansouci/bsb-native#2.1.1"] is trying to unpack in the same destination "/Users/pnore/Library/Caches/Yarn/v1/npm-bs-platform-2.1.1-d76155b709dba032cdb11e99ebe0e2c37bcb2c85" as pattern ["bs-platform@github:bsansouci/bsb-native#2.1.1"]. This could result in a non deterministic behavior, skipping.
warning Pattern ["bs-platform@bsansouci/bsb-native#fast"] is trying to unpack in the same destination "/Users/pnore/Library/Caches/Yarn/v1/npm-bs-platform-2.1.1-d76155b709dba032cdb11e99ebe0e2c37bcb2c85" as pattern ["bs-platform@github:bsansouci/bsb-native#2.1.1"]. This could result in a non deterministic behavior, skipping.
warning Pattern ["bs-platform@github:bsansouci/bsb-native#fast"] is trying to unpack in the same destination "/Users/pnore/Library/Caches/Yarn/v1/npm-bs-platform-2.1.1-d76155b709dba032cdb11e99ebe0e2c37bcb2c85" as pattern ["bs-platform@github:bsansouci/bsb-native#2.1.1"]. This could result in a non deterministic behavior, skipping.
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Building fresh packages...
[1/7] โข€ sdl2
[2/7] โ   ppx-env: ninja: error: rebuilding 'build.ninja': subcommand failed
[3/7] โ   matchenv: ninja: error: rebuilding 'build.ninja': subcommand failed
[4/7] โ   bs-platform
error /Users/pnore/dev/react/gravitron/node_modules/matchenv: Command failed.
Exit code: 2
Command: bsb && cp lib/bs/native/index.native matchenv
Arguments: 
Directory: /Users/pnore/dev/react/gravitron/node_modules/matchenv
Output:
ninja: Entering directory `lib/bs'
[1/3] Building Matchenv.cmi
[2/3] Building src/index.mlast
FAILED: src/index.mlast 
/usr/local/lib/node_modules/bs-platform/bin/bsc.exe -pp "/usr/local/lib/node_modules/bs-platform/bin/refmt.exe --print binary"    -w -40+6+7+27+32..39+44+45 -nostdlib -I '/Users/pnore/dev/react/gravitron/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -c -o src/index.mlast -bs-syntax-only -bs-binary-ast -impl /Users/pnore/dev/react/gravitron/node_modules/matchenv/src/index.re
File "/Users/pnore/dev/react/gravitron/node_modules/matchenv/src/index.re", line 11, characters 17-19:
Error: 1742: Incomplete statement. Did you forget a ";"?

File "/Users/pnore/dev/react/gravitron/node_modules/matchenv/src/index.re", line 1:
Error: Error while running external preprocessor
Command line: /usr/local/lib/node_modules/bs-platform/bin/refmt.exe --print binary '/Users/pnore/dev/react/gravitron/node_modules/matchenv/src/index.re' > /var/folders/vd/_cgkbpk16sx746c9_0cf3r

Thumb hides the planet

On the mobile version the planet is always under my thumb which makes it difficult to see what I'm doing. Could we make the planet's position independent of the finger's position on the screen?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.