Coder Social home page Coder Social logo

themaximalist / infinityarcade Goto Github PK

View Code? Open in Web Editor NEW
62.0 3.0 12.0 74.83 MB

Create any Text Game with AI

Home Page: https://infinityarcade.com

License: MIT License

JavaScript 40.51% CSS 19.90% EJS 39.32% Shell 0.26%
ai game-generator llm text-game arcade gpt-4

infinityarcade's Introduction

Infinity Arcade

create and play any game

infinityarcade-product

Infinity Arcade is a game that can create any game. It uses GPT-4 to create interactive text games based on the users prompts. It also calls Stable Diffusion to generate game art. It's open source and can be installed on your computer (mac, windows, linux) or played at https://infinityarcade.com.

Features

  • Uses GPT-4 and AI to create any game text-based game
  • Uses Stable Diffusion to generate game art
  • Open source

Prerequisites

To run InfinityArcade locally, you'll need:

  • Node.js
  • PostgreSQL
  • OpenAI API key
  • Replicate or Stability API key

Installing

  1. Clone the repository:
git clone https://github.com/username/InfinityArcade.git
cd InfinityArcade
  1. Create a .env file in the root directory with the following content:
OPENAI_API_KEY=your_openai_api_key
REPLICATE_API_KEY=your_replicate_api_key
STABILITY_API_KEY=your_stability_api_key
DATABASE_URI=postgres://username:password@localhost:5432/infinityarcade
DEBUG=ia:*
PORT=3000
NODE_ENV=development
AI_MODEL=gpt-4
AI_IMAGE_MODEL=stability
  1. Install dependencies:
npm install
  1. Run the project in development mode:
npm run dev

The application will now be running at http://localhost:3000.

Contributing

To contribute to the project, please create a pull request.

Demo

A live demo is available at https://infinityarcade.com.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

infinityarcade's People

Contributors

themaximalist 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

Watchers

 avatar  avatar  avatar

infinityarcade's Issues

Collaborating

Hey, I sent you an email from [email protected]

I like your game and think I can help you with it. For example porting it onto android.

Also I have a game called GPT Wars. It is also based on node and gpt. I think maybe we can collaborate on it and split the profits.

[email protected]

Ben

Can not interact with the game .

Hello, I entered the game directly through the link you provided. However, after starting the game, the page continues to display "start..." and I cannot interact with it normally. May I ask what could be the reason for this?

Consider adding ESLint

@themaximal1st This is awesome! Let me be the first to say here, thanks for sharing.

I enjoyed reading though the code, one thing I'd highly recommend is adding ESLint. It is super easy to add and will pickup on a ton of best practices, cleaner code and obvious errors. Here are a few examples.

Here is a sample of the eslint output for the api.js file:

\InfinityArcade\src\client\api.js
    3:65  error    Expected '===' and instead saw '=='  eqeqeq
   12:3   error    Expected 'this' to be used by class async method 'fetch' class-methods-use-this
   13:5   warning  Unexpected console statement no-console
   59:12  error    Redundant use of `await` on a return value no-return-await
   76:5   error    iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations  no-restricted-syntax
   76:31  error    'yieldStreamResponse' was used before it was defined no-use-before-define
  100:20  error    Unexpected `await` inside a loop no-await-in-loop
  131:55  error    'chat_id' is not defined  no-undef

Here is how to add ESLint

Run npm init @eslint/config and pick the options. For this project I'd pick:

  • To check syntax, find problems, and enforce code style
  • CommonJS (require/exports)
  • None of these
  • No
  • Node
  • Use a popular style guide
  • AirBnB
  • Javascript

For VSCode syntax highlighting install the ESLint extension.

Add this to the package.json file then you can run npm run lint to check and fix all your files in one go.

"scripts": {
  "lint": "eslint --fix --ext .js,.jsx .",
  ...
}

If you really love some coding style, like camelcase, then you can easily adjust this in the .eslintrc.js file by adding a rule like this:

module.exports = {
  rules: {
    camelcase: 'off'
  },
  ...
};

Finally, if you want VSCode to try and fix issues when the file is saved, add this to the VSCode settings file.

{
    "editor.formatOnSave": false,
    "editor.codeActionsOnSave": {
        "source.fixAll": true
    }
}

References

Feature request: History

When playing a game, it would be great if you could see the previous prompts and choices you've made. Ideally, in a way that you could just copy the entire thing and save as .txt or some other format.

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.