Giter Site home page Giter Site logo

swarm's Introduction

Swarm

Build Status Contributor Covenant GitHub Contributors

Swarm is a 2D programming and resource gathering game. Program your robots to explore the world and collect resources, which in turn allows you to build upgraded robots that can run more interesting and complex programs.

World 0 after scanning a tree and making a log.

The implementation is still in an early stage, but these are some of the (planned) features:

  • Practically infinite 2D procedurally generated worlds
  • Simple yet powerful programming language based on the polymorphic lambda calculus + recursion, with a command monad for describing first-class imperative actions
  • Editor support with LSP and highlighting
  • In-game tutorial
  • Multiple game modes:
    • In Classic mode, you start with the ability to produce only very basic, limited robots; collecting resources allows you to bootstrap your way into programming more sophisticated robots that can explore more of the world, collect more resources, etc.
    • Creative mode places no restrictions: program robots to your heart's content using whatever language features you want, without worrying about collecting resources.
    • There are also challenge scenarios where you attempt to program robots in order to solve pre-designed puzzles or challenges.
    • Future versions might also have multiplayer modes, with co-op or PvP play over a network...?

Installing and Playing

Warning: Swarm is still in an early stage; it's missing many of the planned features, there is no winning condition, and the gameplay is not very deep yet. But you can program cute little robots, and hey, that's all that really matters, right?

NOTE: Swarm requires a POSIX-style environment that supports terminfo. On Linux and OSX, the below instructions should work natively. On Windows, see the comments on this GitHub issue for instructions getting it to work under the Windows Subsystem for Linux.

The recommended way to install Swarm at the moment is as follows:

  1. Clone the Swarm repository, e.g.

    git clone https://github.com/swarm-game/swarm.git
    
  2. If you don't already have the stack tool:

    1. Get the ghcup tool, a handy one-stop utility for managing all the different pieces of a Haskell toolchain.

    2. Use ghcup to install stack:

      ghcup install stack
      
  3. It is recommended that you use a relatively large terminal window (e.g. 132 columns x 43 rows or larger).

    • To find out the size of your terminal, you can type stty size.
  4. Now use stack to build and run Swarm:

    cd /path/to/the/swarm/repo
    stack run
    
  5. Go get a snack while stack downloads a Haskell compiler and all of Swarm's dependencies.

  6. Have fun! At the moment, you probably want to take a look at the tutorial to help get you started. Eventually there will be an in-game tutorial.

Programming swarm

Your base has a dictionary to store definitions, like this one:

def moveUntil : cmd bool -> cmd () = \predicate.
  res <- predicate;
  if res {
    noop
  } {
    moveUntil predicate
  }
end

The indentation is not required but ; is, as it is similar to Haskell >> - that is the command monad, which imperative programmers can ignore. ๐Ÿ˜‰

This allows you to program robots to perform complicated tasks.

While you can write commands and definitions like the one above in the REPL, swarm also has a editor support with highlighting and LSP integration:

Editor with problem popup

See the editors folder for details on how to configure your editor.

Community

Check out the COMMUNITY page for ways to connect with others in the community.

If you want to contribute, you're most welcome! There are lots of ways to contribute, regardless of your Haskell background. For example, even someone with no Haskell experience whatsoever could still help with e.g. game design, playtesting, and level design for challenge mode. Check out the CONTRIBUTING file for more specific information about how to contribute.

swarm's People

Contributors

byorgey avatar xsebek avatar tristancacqueray avatar twitu avatar alexander-block avatar polux avatar noahyor avatar lsmor avatar 7h3w1zz avatar juhp avatar elderephemera avatar samtay avatar danidiaz avatar huwcampbell avatar fryguybob avatar

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.