• Stars
    star
    880
  • Rank 51,881 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿƒ Learn to code by making games in a JavaScript web-based game editor.

๐Ÿƒ Hack Club Sprig ๐Ÿƒ

๐Ÿ’ป Online Editor: Make a game | ๐Ÿ‘€ Gallery: Find games | ๐Ÿ•ธ Landing Page | ๐ŸŽฎ Firmware | ๐Ÿ‘พ Engine

Sprig is a game console where every user is a creator. It can only be obtained by building a tile-based game in the web-based game editor and shipping it in the community gallery. It's made by Hack Club.

Screen Shot 2022-08-22 at 4 02 04 PM

You should be able to get started in Sprig with very little programming experience. Even if you're an expert, you should still be able to have fun. Sprig games are designed to be shared and hacked on with friends. Every game submitted is easily viewable and editable in our gallery allowing people to learn from and build off each other.

Sprig is a

custom handheld game console built by Hack Club. Fall of 2022, we are giving a Sprig (valued at over $100 in components alone) to every teenage hacker that successfully shares a game they create in our community gallery.

Screen Shot 2022-08-22 at 4 02 04 PM

web-based game editor that transforms learning to code from studying language syntax to making small creative projects. The Sprig game engine exposes a small construction kit for making tile-based games. This construction kit helps you focus on being creative instead of learning big APIs. The games are just JavaScript and we built a custom system to run that same JavaScript on the microcontroller!

Screen Shot 2022-03-07 at 6 21 27 PM

hardware development kit. Itโ€™s not just for gaming! The Sprig console is designed to be assembled and disassembled. Each kit includes parts needed for getting started with hardware engineering and embedded systems programming. This includes a Raspberry Pi Pico, a TFT7735 screen, a MAX98357A I2S class D audio amplifier, a whole bunch of buttons, LEDs, a speaker, and a carrier board which wires all these components together while exposing the remaining pins on the microcontroller. Itโ€™s a complete system for generating graphics, sound, and handling tactile inputs which is reprogrammable at the touch of a button.

Screen Shot 2022-08-22 at 4 04 08 PM

Fully open source

Sprig is open source. Shipping a game to the Sprig Gallery is contributing to an open-source project. Everything about Sprig is transparent and editable. That includes the hardware designs, the game engine, the embedded game engine for the RP2040 chip, and the editor and website itself (this repo)!

We did some fun engineering to get Sprig to work and to make your games run the same on your desktop computer and a $4 microcontroller. That involved custom JS runtimes with optimizations in C and even PIO assembly. We also documented some behind-the-scenes.

You Ship, We Ship

Make a game โ†’ Share it with the community โ†’ Receive your device โ†’ Play Sprig games on it โ†’ Hack on the device for more projects

Only teenagers and younger can receive Sprigs! All are welcome to submit to the gallery though.

Philosophy

People learn best when they make things that they care about, which they can then share with others. This type of learning philosophy is called constructionism, and Sprig is a type of microworld. A microworld is an environment where you can discover programming by using it to express yourself.

Tutorials

To get started you can follow this challenge in the editor, check out some Sprig workshops or watch some short videos to get acquainted with Sprig:

Development

Join the #sprig channel on the Hack Club Slack where you can join the development discussion and ask for help, and to learn more about how to make games with Sprig check out the docs.

Sprig's editor and site pages are built with Astro using Preact for rendering. Perhaps somewhat unusually, we predominantly use Preact Signals for state management. The project structure is as follows:

  • src/pages/ contains all the site's main pages and API routes. In general, .ts files are API routes and .astro files are pages. All pages are server-side rendered on demand and can make database calls and such.
  • src/components/ contains all the components used in the editor and site pages. Most components will have accompanying .module.css files which contain vanilla CSS stylesheets which are scoped to the component. These "CSS modules" can be imported as a JS object containing referencable class names.
  • src/lib/ contains all the support code. Currently this is a mix of server and client code.
  • src/legacy/ has a bunch of old code from the v1 version of the editor which is kept for ease of porting the home and Get a Sprig pages. Since Astro lets us combine multiple frameworks, we're also using old Svelte code in some places.
  • docs/ contains documentation on how to use Sprig, including docs.md which contains the help file embedded in the editor.
  • public/ contains static assets which are directly served.
  • src/global.css and src/components/standard-head.astro contain code that's generally shared across all pages.

Everything pushed to GitHub and all pull requests are automatically deployed on Vercel.

Prerequisites

Things you'll want installed:

We use Firebase as a database. To develop login/saving related features locally, you'll likely want to create a Firebase project for yourself. Then, create a service account, download the JSON file, and convert the contents to base64 (link to a tool to easily do this).

We recommend Visual Studio Code as a code editor. You should be automatically prompted to install some recommended extensions when you open the project.

Project Setup

In a terminal, clone the repo and install packages:

git clone https://github.com/hackclub/sprig/
cd sprig
yarn install

Next, you'll want to give Sprig access to the Firebase credentials you created. Make a .env file in the root of the project and enter FIREBASE_CREDENTIAL= followed by the base64 string you generated.

To start the dev server, run yarn dev and visit http://localhost:3000 in your web browser! Please create a GitHub issue if you cannot get something to work properly.

Engine Development

All engine code (responsible for running games, playing tunes, etc.) is in a different repo: https://github.com/hackclub/sprig-engine/.

If you want to work on the engine and test out your changes in the context of this repo, you'll want to use a feature called linking.

First set up the engine repo:

git clone https://github.com/hackclub/sprig-engine/
cd sprig-engine
yarn install
yarn link

Then, in this website's repo:

yarn link sprig

Now, run yarn dev in the engine repo to start the TypeScript build process.

Acknowledgements

The Sprig was developed by a team at Hack Club with assistance from Brian Silverman (who helped develop Scratch and the precursor to Lego Mindstorms), Vadim Gerasimov (engineer at Google who helped create Tetris when he was 15), and Quentin Bolsรฉe (researcher at MIT and Vrije University Brussels), and dozens contributions from teenage open-source developers!

We're also grateful for amazing open-source projects that make this possible like Kaluma, JerryScript, uhtml, and CodeMirror.

License

The Hack Club Sprig is open source and licensed under the MIT License. Fork, remix, and make it your own! Pull requests and other contributions greatly appreciated.

More Repositories

1

putting-the-you-in-cpu

A technical explainer by @kognise of how your computer runs programs, from start to finish.
MDX
4,913
star
2

some-assembly-required

๐Ÿ“– An approachable introduction to Assembly.
Assembly
2,983
star
3

hackclub

๐ŸŒŽ Hack Club is a worldwide community of high school hackers. We make things. We help one another. We have fun.
JavaScript
2,383
star
4

OnBoard

๐Ÿ’ก Join 1,000 teenagers and make your first PCB with a $100 grant!
Svelte
715
star
5

dinosaurs

๐Ÿฆ• A collection of Orpheus (Hack Club's mascot) drawings!
609
star
6

sinerider

๐Ÿ’– A game about love and graphing, built by teenagers.
JavaScript
551
star
7

blot

๐Ÿค– โœ๏ธ blot, the plotting bot from hack club
JavaScript
317
star
8

jobs

$ ssh jobs.hackclub.com
Go
200
star
9

site

๐ŸŒˆ The new, new Hack Club website (uses Next.js & Theme UI).
JavaScript
185
star
10

how-did-i-get-here

A tool/website/article by @kognise about how routing on the Internet works.
TypeScript
173
star
11

scrapbook

๐Ÿ”ฅ A daily streak system & portfolio for your projects.
JavaScript
168
star
12

design-system

Hack Club's (old) design system
JavaScript
156
star
13

hackathons

๐Ÿ’ฅ Open source directory of free student-led high school hackathons.
JavaScript
148
star
14

dns

๐Ÿ•น Manage Hack Club's DNS through a GitHub repository
YAML
132
star
15

burrow

Burrow is a tool for burrowing through firewalls, built by teenagers at Hack Club.
Rust
114
star
16

ktr

Kog traceroute. Highly asynchronous traceroute program written in Rust with ASN WHOIS and PeeringDB lookups.
Rust
105
star
17

v2

Hack Clubโ€™s (old) website โœจ
JavaScript
103
star
18

workshops

๐Ÿ’ฝ Website for Hack Club workshops.
JavaScript
88
star
19

outernet

๐Ÿ•๏ธ An out-of-doors, make-it-yours programming adventure. July 28th to 31st 2023 in Vermont's Northeast Kingdom.
82
star
20

muse

๐ŸŽธ a simple language for jamming!
JavaScript
82
star
21

winter

โ„๏ธ Join the community for a Winter of Making!
80
star
22

theme-starter

๐Ÿค A sample Next.js project for getting started with MDX, Theme UI, & Hack Club Theme.
JavaScript
78
star
23

the-hacker-zephyr

๐Ÿš‚ The Hacker Zephyr: A cross-country hackathon on a train! This repo: all of our planning documents, finances, and code open sourced.
78
star
24

assemble

๐ŸŒ The behind-the-scenes of the first high school hackathon since the pandemic!
Assembly
71
star
25

hackathons-v1

๐Ÿ’ป๐Ÿ’ฅ Open source directory of free student-led high school hackathons used by thousands of students worldwide (join the mailing list on the website!)
JavaScript
67
star
26

awesome-hackclub

A collection of super awesome projects made by Hack Clubbers
Markdown
65
star
27

theme

๐Ÿ’ซ Hack Clubโ€™s theme + React components for Theme UI
TypeScript
59
star
28

slash-z

๐Ÿค /z to create a new Zoom Pro meeting in the Hack Club Slack
JavaScript
48
star
29

scrappy

๐Ÿ—‘๏ธ the bot that eats trash (and manages #scrapbook)
JavaScript
47
star
30

sprig-hardware

๐ŸŒฑ Hardware designs for the Sprig Console
44
star
31

proxyparty

๐ŸŽŠ An Nginx redirector and proxier for all of Hack Club's needs!
Nix
44
star
32

webring

๐Ÿ’ A webring for the personal websites of Hack Club members
HTML
43
star
33

hackpad

Python
41
star
34

spade

run sprig games on pc + pico. call a spade a spade.
C
40
star
35

api

[DEPRECATED] The backend (that used to) power Hack Club.
Ruby
38
star
36

icons

Hack Clubโ€™s iconset, a superset of spectrum-icons
TypeScript
37
star
37

jams

We're jamming!
JavaScript
34
star
38

ai-safety-dance

HTML
34
star
39

nest

Free, powerful, and versatile compute infrastructure for all high school hackers!
TypeScript
33
star
40

orbit

NOT MAINTAINED: Orbit puts your development environment in the cloud.
Go
33
star
41

apac_certificate_generator

JavaScript
33
star
42

hacklang

๐Ÿ–ฅ A programming language created for and by hackclubbers.
TypeScript
32
star
43

toriel

๐Ÿ‘‹ A friendly bot that assists new members with joining Hack Club
JavaScript
32
star
44

events

Airtable-powered directory of upcoming events in the Hack Club community.
JavaScript
30
star
45

hack.af

Hack Club's PostgreSQL-based shortlink router. Now running serverlessly!
JavaScript
28
star
46

huginn-docker

Production-ready Huginn deployment with Docker.
Dockerfile
28
star
47

airbridge

๐ŸŒ‰ The link that ties Hack Club's information together
JavaScript
27
star
48

technicolor

๐ŸŸฆ๐ŸŸช๐ŸŸฅ๐ŸŸง๐ŸŸจ๐ŸŸฉ A Hack Clubber's journey, written June 2021.
26
star
49

cow2

Hack Club Cow 2.0 ๐Ÿ„ - a GPT-3 powered cow chatbot for Slack
TypeScript
26
star
50

hacker-challenge

Use your web inspector to hack your way through a series of challenges.
HTML
26
star
51

css

The Hack Club Theme packaged as raw CSS.
CSS
25
star
52

epoch

๐ŸŽ† Behind the scenes at Epoch โ€” a magical New Year's spent hacking in the Delhi NCR.
24
star
53

HCCore

๐Ÿ”Œ Main plugin for the Hack Club Minecraft server
Java
24
star
54

www-assemble

๐ŸŒ The landing page for Assemble. Built using Next.js, Theme UI & MDX.
JavaScript
24
star
55

hackstore

The official hackclub store
JavaScript
24
star
56

the-trail

4 Week PCB Hackathon & 1 Week PCT Hikeathon
JavaScript
23
star
57

moonbeam

๐Ÿš€๐ŸŒ– to the moon!
Python
23
star
58

meta

โš ๏ธ moved to hackclub/hackclub
23
star
59

camp

Hack Club's summer camp
CSS
23
star
60

apac-directory

JavaScript
23
star
61

orpheus-bot

https://youtu.be/R8FVKVnYfY8
JavaScript
23
star
62

sprig-engine

The standalone Sprig game engine.
TypeScript
23
star
63

summer-site

โ˜€๏ธ Recap website for Hack Clubโ€™s Summer of Making 2020, built with Next.js + Theme UI.
JavaScript
23
star
64

jams-bounty

[SUBMISSIONS CLOSED] build a jam, get $200 ๐Ÿซ๐Ÿ“๐Ÿ‡
22
star
65

vip-newsletters

Email updates sent to Hack Club's largest supporters every month.
21
star
66

banker-bot

Hack Club Slack's banker bot
JavaScript
21
star
67

hackathons-backend

Powering https://hackathons.hackclub.com
Ruby
21
star
68

newsletter

๐Ÿ‘€ Whatโ€™s up at Hack Club?
21
star
69

simple-stable-diffusion

๐ŸŒ„ Get Stable Diffusion running in less than 10 minutes in Colab!
Jupyter Notebook
21
star
70

maxday

React + Gatsby website for displaying Max's birthday wishes. Written mostly by @lachlanjc.
JavaScript
21
star
71

hack-as-a-service-v0

โš ๏ธ We've moved to @hack-as-a-service! โš ๏ธ
TypeScript
20
star
72

hcbapp

๐Ÿ’ธ do your finances with a mobile app
Swift
20
star
73

apply

๐Ÿš€ Website for applying to start a Hack Club!
JavaScript
20
star
74

hackathon-photos

๐Ÿ“ธ An open-source directory of photos from high-school hackathons.
19
star
75

markdown

Render Markdown to HTML, Hack Club-style
JavaScript
19
star
76

resource

๐Ÿ’ป Community maintained collection of Hacker Resources
19
star
77

ledger

Home of Hack Club's finances.
Shell
19
star
78

8-ball

the hack club omniscient 8-ball
Python
19
star
79

all-aboard

The Hacker Zephyr Homepage!
JavaScript
18
star
80

horizon

Horizon was Hack Club's first all-female/nonbinary hackathon weekend!
JavaScript
17
star
81

dungeon-of-the-slack

Haskell
17
star
82

slacker

Slacker is an attempt to organize and systematize our developer/customer support use cases into something that is easy to manage and measure, and also is welcoming of newcomers wanting to help participate on projects.
TypeScript
16
star
83

lore

A timeline of Hack Club's history!
JavaScript
16
star
84

holiday-livestream-overlay

https://hack.af/holidays
HTML
16
star
85

Rudolph

Giving gp to hack clubbers who contribute to open source!
Swift
16
star
86

airbender

๐Ÿš Airtable assist
JavaScript
16
star
87

sprig-gallery

Moved to https://github.com/hackclub/sprig/
Svelte
16
star
88

gamelab-beaker

Python
16
star
89

draw-dino

JavaScript
16
star
90

caches

๐Ÿ“€ Caches of hacker culture in the 2020s, placed around the world by Hack Clubbers.
15
star
91

clippy

A friendly bot that assists new members with joining Hack Club
JavaScript
15
star
92

steve

steve
15
star
93

www-epoch

Epoch's website!
JavaScript
15
star
94

forge

C
14
star
95

shipped

DEPRECATED: Showcase of projects shipped by members :shipit:
CSS
14
star
96

assemble-puzzle

๐Ÿ” Solve the puzzle to reveal Hack Club's 2022 summer event: Assemble.
JavaScript
14
star
97

mfa

Hack Club's solution for sharing multi-factor authentication (MFA) codes for team accounts
TypeScript
14
star
98

wonderland

๐Ÿ•ณ๏ธ๐Ÿ‡๐Ÿฅ•
HTML
14
star
99

scrapbook-domains

Custom domain support for https://scrapbook.hackclub.com/
JavaScript
14
star
100

pass-the-story

HTML
14
star