Giter Club home page Giter Club logo

24a2's Introduction

24a2

24a2 is a simple game engine that lets you to build a game in a few hours. It has a very limited set of features which makes it easy to learn, and encourages you to solve problems creatively.

24a2 games are written in JavaScript (or TypeScript) and are played in a web browser, so you can easily share what you’ve created.

All 24a2 games feature a 24 by 24 grid of dots. You can set the color of each dot, and read the color of each dot back. 24a2 can also run a function you define when an arrow key is pressed, or when a dot is clicked on.

That’s about it! There are a few other features, which you can find out about in the tutorial and the API reference.

Using 24a2 means you don’t have to think about the visual style of your game, complicated physics or sound - you can just focus on actually building something.

Please see our website for more information, examples, and a tutorial

Games built with 24a2

If you've built something using 24a2 please let us know! Feel free to open an Issue or Pull Request to add it to this list.

24a2's People

Contributors

bernardini687 avatar graphnode avatar happyfacade avatar jamesroutley avatar jonnyroutley avatar keatonfs avatar kentbrew avatar micahcantor avatar pbcraig avatar r3pwn avatar shaneriley avatar tchapeaux 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

24a2's Issues

Configurable clear color

Instead of always clearing with Color.Gray, maybe add a clearColor field to config that defaults to Color.Gray. This way user doesn't have to overwrite the colors manually.

var config = {
  clearColor: Color.Black // Change clear color to black
}

Sharing games made with 24a2

I just finished my first game in the engine. It was a great experience (aside from Javascript headaches).

Do you have a supported channel for sharing the games?

Feature request: set text color

My latest has a black background and I can't see how to change the text color so it shows. If we could pick from the list of standard colors that would be excellent.

ES6 modules support

Hello, I have a TypeScript project, which I'm building with Parcel, and I cannot import the library using import syntax.

Example:
import '24a2'
Error :
Cannot resolve dependency '24a2'.

It can be resolved by adding field "module": "build/engine.js" to package.json file.

After that, if I'm trying to import specific entity, for example import { Game } from '24a2';, then Game is undefined.
I think Game and other entities should be exported in source file.

I tried adding export, but after that compiler also required p5 import, as it considers this file a module now. So it would probably need some additional building tool for module bundling like webpack.

Consider dropping P5 as a dependency

24a2 uses of P5.js to draw things. It uses a very small subset of P5 features, so it seems wasteful to require users to load it. Users also shouldn't have to know about P5 at all. Here are some unstructured thoughts

  • At a minimum, we should hide that we're using P5 from users. We can do this by including the bits of P5 that we use in engine.js
  • We can also remove it entirely by calling the Canvas APIs directly. I've only used Canvas a bit, but I don't think this would be too difficult
  • It would be nice if we abstracted 24a2's engine logic from the presentational layer. A couple of people have spoken about using 24a2 to program a 24x24 grid of physical LEDs, and it might be nice to set things up for that.

A list of featured games?

You could add a list of games that people have made to the website or README.md or both so that they're more easily discoverable.

I'm currently working on a Space Invaders clone, playable at https://incoherency.co.uk/24invaders/ mostly works already, but I have a bit more graphics work to do.

And, for what it's worth, I love 24a2. It brings back the fun that got me into programming in the first place.

onDotClicked() doesn't work when the canvas has padding

For my game's layout I wanted to give its canvas some padding via CSS, but that caused the coordinate calculation in CanvasIOManager.prototype._listenForMouseClick to fail. I guess the result of getBoundingClientRect() includes the padding. Hopefully there is an easy fix.

While we're at it: there must be a more efficient way to find the correct dot than to iterate over all of them.

I'd be willing to fix this myself, if pull requests are appreciated.

Investigate mobile support

We've had lots of requests for mobile support - let's work out how it could work.

  • Screen size might be an issue - what if the screen cuts columns of the grid off?
  • Touch input vs virtual arrow keys

Custom grid size

First of all I wanted to say thanks for the awesome project 😄

It was really easy to get up and running and the tutorial was amazing!

As far as I can tell currently, the grid size is 24x24 and there's no way to configure that; are there any plans to allow the grid size to be configurable?

Happy to have a crack at implementing it, but I thought I'd get the maintainers thoughts before diving in 😄

Feature request: custom grid size

While the concept (and the name!) are sticking to a 24x24 grid, which I guess is much part of the KISS, I still feel that allow custom size grids would be great.

From the features, there’s evidence that the power of the library is not based as much on the small grid size as it is on the simple API.

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.