Coder Social home page Coder Social logo

lettier / lambda-lantern Goto Github PK

View Code? Open in Web Editor NEW
160.0 8.0 10.0 13.29 MB

๐Ÿง™ โ€Žโ€Ž A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.

Home Page: https://medium.com/@lettier/how-to-create-3d-games-with-purescript-and-cpp-faabf8f27fe6

License: BSD 3-Clause "New" or "Revised" License

Makefile 8.28% PureScript 91.72%
panda3d purescript cpp cpp11 game game-development bindings functional-programming haskell purescript-native

lambda-lantern's Introduction

Lambda Lantern ๐Ÿ˜ƒ

Lambda Lantern

What is Lambda Lantern? ๐Ÿค”

Lambda Lantern

Lambda Lantern is a game made with PureScript, PureScript Native, and Panda3D. The premise of the game involves collecting and using functional programming patterns to solve puzzles and ultimately escape a dungeon.

One of the purposes of Lambda Lantern is to demonstrate binding PureScript to C++.

Lambda Lantern originally started as a GitHub Game Off submission.

How do I build and run Lambda Lantern? ๐Ÿ”จ

Lambda Lantern

# Install Git.
# Install nvm (https://github.com/creationix/nvm).
# Install Panda3D (https://www.panda3d.org/download/sdk-1-10-1/).
# Install Haskell Stack (https://docs.haskellstack.org/en/stable/README/).

cd

# Install PureScript Native (https://github.com/andyarvanitis/purescript-native).

git clone https://github.com/andyarvanitis/purescript-native.git
cd purescript-native
git checkout aa857adec6aa40edac91bcacfe4c3b7c5f1c3f2d
stack install

cd

# Update path for PureScript Native compiler pscpp.

export PATH="${PATH}:${HOME}/.local/bin"

# Download and install the FFI exports.

git clone https://github.com/lettier/purescript-native-ffi.git
cd purescript-native-ffi
git checkout lambda-lantern

cd

git clone https://github.com/lettier/lambda-lantern.git

# Note the trailing dot.
cp -nr purescript-native-ffi/. lambda-lantern/ffi/

cd lambda-lantern

# Install Node.js.

nvm install `cat .nvmrc` && nvm use

# Install PureScript and psc-package.

npm install -g [email protected] [email protected]

# Install the PureScript dependencies.
psc-package install

# Build Lambda Lantern.
# Double check the include and lib paths.
# You may need additional flags for your platform.

make \
  CXXFLAGS=" \
    -fmax-errors=1 \
    -I/usr/include/python \
    -I/usr/include/panda3d \
    -I/usr/include/freetype2" \
  LDFLAGS=" \
    -L/usr/lib/panda3d \
    -lp3framework \
    -lpanda \
    -lpandafx \
    -lpandaexpress \
    -lp3dtoolconfig \
    -lp3dtool \
    -lp3pystub \
    -lp3direct \
    -pthread \
    -lpthread"

# Run Lambda Lantern.

LAMBDA_LANTERN_ASSETS_PATH="./assets" ./output/bin/lambda-lantern

What is the license? ๐Ÿ“œ

Lambda Lantern

For license information, see LICENSE.

Who wrote Lambda Lantern? ยฉ๏ธ

Lambda Lantern

(C) 2018 David Lettier
lettier.com

lambda-lantern's People

Contributors

lettier 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

lambda-lantern's Issues

Type error building on MacOS

Hi, I'm trying to build Lambda Lantern on Mojave (10.14.5) following the instructions in the readme. When I get to the make step, I get some type warnings, and then it fails with:

Error found:
in module Data.Set.NonEmpty
at .psc-package/lambda-lantern/ordered-collections/v1.4.0/src/Data/Set/NonEmpty.purs:54:16 - 54:89 (line 54, column 16 - line 54, column 89)

  Could not match type

    NonEmptyList a0

  with type

    m1


while checking that type forall a. NonEmptySet a -> NonEmptyList a
  is at least as general as type NonEmptySet a0 -> m1
while checking that expression (compose (foldMap1 f)) toUnfoldable1
  has type NonEmptySet a0 -> m1
in value declaration foldable1NonEmptySet

where m1 is a rigid type variable
        bound at (line 0, column 0 - line 0, column 0)
      a0 is a rigid type variable
        bound at (line 0, column 0 - line 0, column 0)

See https://github.com/purescript/documentation/blob/master/errors/TypesDoNotUnify.md for more information,
or to contribute content related to this error.


make: *** [corefn] Error 1

One difference in my environment is that I am using nodenv rather than nvm to manage Node versions, but I did make sure to try with version 10.8.0, as specified in the project's .nvmrc. Did I mess up an earlier step?

Trouble linking on macOS

Maybe you can help me figure this out:

I compile with these arguments:

make \
  CXXFLAGS=" \
    -fmax-errors=1 \
    -I/usr/include/python2.7 \
    -I/Developer/Panda3D/include \
    -I/usr/local/Cellar/freetype/2.9.1/include/freetype2" \
  LDFLAGS=" \
    -L/Developer/Panda3D/lib \
    -lp3framework \
    -lpanda \
    -lpandafx \
    -lpandaexpress \
    -lp3dtoolconfig \
    -lp3dtool \
    -lp3pystub \
    -lp3direct \
    -pthread \
    -lpthread"

I receive this output https://gist.github.com/i-am-the-slime/8e34436d69b5024503f4061df69a7e62

Which complains about Undefined symbols for architecture x86_64. I am confused which headers are not there for 64 bits.

value "Games;" for key "Categories" in group "Desktop Entry" contains an unregistered value "Games"

com.lettier.lambda-lantern.desktop: error: value "Games;" for key "Categories" in group "Desktop Entry" contains an unregistered value "Games"; values extending the format should start with "X-"
/tmp/.mount_appimadASamW/com.lettier.lambda-lantern.desktop: hint: value "Games;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu

Reference:
AppImage/appimage.github.io#1006

Pop OS glibc error

$ ./lambda-lantern-0.0.0.0-x86.AppImage
lambda-lantern: /tmp/.mount_SuMi9z/usr/lib/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libtiff.so.5) lambda-lantern: /tmp/.mount_SuMi9z/usr/lib/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libwebp.so.6)
lambda-lantern: /tmp/.mount_SuMi9z/usr/lib/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libvorbis.so.0) lambda-lantern: /tmp/.mount_SuMi9z/usr/lib/libm.so.6: version GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libopus.so.0)

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.