bitsy-hacks icon indicating copy to clipboard operation
bitsy-hacks copied to clipboard

a collection of re-usable scripts for bitsy game maker

bitsy hacks

npm i @bitsy/hecks

A collection of re-usable scripts for Adam Le Doux's Bitsy Game Maker. See Ayolland's Borksy for a GUI that allows you to use these hacks with less copy-pasting.

Last tested against Bitsy 8.1

  • Contents
  • How to use
  • FAQ
  • Old Versions
  • Further reading

Contents

  • ๐Ÿ‘ฅ avatar by room: change the avatar in certain rooms
  • ๐Ÿ–ผ backdrops: makes the game have a backdrop
  • ๐Ÿ”ˆ basic sfx: "walk" and "talk" sound effect support
  • ๐Ÿ˜Œ bitsymuse: A variety of Bitsy sound and music handlers
  • ๐Ÿ˜ด canvas replacement: WebGLazy bitsy integration (this one's mostly just for me)
  • ๐Ÿ˜ฝ character portraits: high quality anime jpegs (or pngs i guess)
  • ๐Ÿ™€ character portraits animated: high quality anime gifs
  • โ›”๏ธ close on ending: Prevents from playing past an ending
  • โžฟ corrupt: corrupts gamedata at runtime
  • ๐ŸŽž custom-exit-effects: make custom exit transition effects
  • ๐Ÿ…ฐ custom text effect: make {custom}text effects{custom}
  • ๐Ÿ’ฌ dialog audio: animal crossing-style audio
  • ๐ŸŽบ dialog audio vocal synth: animal crossing-style audio powered by the pink trombone vocal synth
  • ๐Ÿ” dialog box transition: adds an easing transition animation to display the dialog box text
  • ๐Ÿ”€ dialog choices: dialog choices
  • ๐Ÿš€ dialog jump: jump from one dialog entry to another
  • ๐Ÿ’ฌ dialog pause: add pauses in between printing text
  • โŒจ dialog prompt: prompt the user for text input in dialog
  • โ†” directional avatar: flips the player's sprite based on directional movement
  • ๐Ÿ” direction in dialog: provides a variable with player direction
  • ๐Ÿ–ผ dynamic background: HTML background matching bitsy background
  • ๐Ÿ“ edit dialog from dialog: edit dialog from dialog (yes really)
  • ๐Ÿ–Œ edit image from dialog: edit sprites, items, and tiles from dialog
  • ๐Ÿ‘ฏโ€โ™‚๏ธ edit player from dialog: change which sprite is controlled by the player
  • ๐Ÿ  edit room from dialog: modify the content of a room from dialog
  • ๐Ÿ”š end-from-dialog: trigger an ending from dialog, including narration text (deprecated)
  • ๐Ÿšช exit-from-dialog: exit to another room from dialog, including conditionals
  • ๐Ÿ›ฐ external-game-data: separate Bitsy game data from your (modded) HTML for easier development
  • ๐ŸŒ favicon-from-sprite: generate a browser favicon (tab icon) from a Bitsy sprite, including animation!
  • ๐Ÿ’• follower: make sprites follow the player
  • ๐ŸŽฎ gamepad input: HTML5 gamepad support
  • ๐Ÿ‚ gravity: Pseudo-platforming/gravity/physics
  • ๐Ÿ•ท itsy-bitsy: for when bitsy's not small enough
  • โ˜• javascript dialog: execute arbitrary javascript from dialog
  • ๐Ÿ”€ logic-operators-extended: adds conditional logic operators
  • ๐Ÿ“œ long dialog: put more words onscreen
  • ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง multi-sprite avatar: make the player big
  • ๐Ÿ”„ online: multiplayer bitsy
  • โฌ› opaque tiles: tiles which hide the player
  • ๐Ÿ“ƒ paragraph-break: Adds paragraph breaks to the dialogue parser
  • โณ permanent items: prevent some items from being picked up
  • โžก push sprites: sokoban-style sprite pushing
  • ๐ŸŽญ replace drawing: add name-tags to replace drawings when the game is loading
  • ๐Ÿ’พ save: save/load your game
  • ๐Ÿ›‘ solid items: treat some items like sprites that can be placed multiple times
  • โฑ๏ธ stopwatch: time player actions
  • ๐Ÿ—ฃ text-to-speech: text-to-speech for bitsy dialog
  • ๐Ÿฐ tracery processing: process all dialog text with a tracery grammar
  • ๐ŸŽž transitions: customizable WebGL transitions
  • ๐Ÿ”ณ transparent background: makes the game have a transparent background
  • ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ transparent dialog: makes the dialog box have a transparent background
  • ๐Ÿ transparent sprites: makes all sprites have transparent backgrounds (deprecated)
  • ๐Ÿ’ฑ twine bitsy comms: interprocess communication for twine and bitsy
  • โ„ unique items: items which, when picked up, remove all other instances of that item from the game

Custom text effect demoFollower demoUnique items demo

How to use

Each script has a short "HOW TO USE" section included in the comments. For steps which say to Copy-paste this script into a script tag after the bitsy source, open your exported bitsy game and scroll to the bottom of the file (at the time of writing, it looks like this):

</script>

</head>


<!-- DOCUMENT BODY -->
<body onload='startExportedGame()'>
  <!-- GAME CANVAS -->
  <canvas id='game'></canvas>
</body>


</html>

then edit it to look like this:

</script>

<script>
  // and then paste your code here!
</script>

</head>


<!-- DOCUMENT BODY -->
<body onload='startExportedGame()'>
  <!-- GAME CANVAS -->
  <canvas id='game'></canvas>
</body>


</html>

FAQ

  • I don't know javascript. Can I still use the hacks?

    Yes, most of the hacks require little to no javascript experience.

  • Can I import a hacked file back into the Bitsy editor?

    Yes, but unfortunately only the gamedata will be imported, and the hacks will be lost. To edit a hacked game, it's recommended that you keep a copy of the hacked html file, and copy-paste edited gamedata into it. If you need to do this a lot, there are a few tools available to speed up your workflow (e.g. bitsy-savior, Borksy, bitsy-boilerplate).

  • Some of these hack files are kinda long. Do I need to copy the whole thing?

    Yes, you need the entire hack file in order for it to work. If for some reason you're really concerned with filesize (you shouldn't be), you can programmatically compose and minify them (either by cloning this repo or by using the bitsy-boilerplate project), but this is only recommended for developers familiar with javascript bundling.

  • Can I combine multiple hacks?

    Yes, but there are known issues with specific combinations. If you're having issues using multiple hacks, try testing them one at a time to make sure they've each been setup correctly.

  • Do the hacks work with forks like Bitsy 3D, Bitsy HD, or Bitsy Color?

    It varies by hack and by fork. If something doesn't work, try testing against a regular Bitsy game to make sure you've setup the hack correctly.

    Bitsy HD in particular is a fairly old fork, and generally needs older versions of hacks.

  • Do the hacks work with emulators like bitsy boutique or bitsybox?

    No. Emulators function by re-implementing parts of the engine and/or browser into another environment, but the hacks rely heavily on how the engine is structured and how the browser handles <script> tags. However, desktop projects which preserve the original engine/browser context (e.g. Electron, NW.js) can be used.

If your question isn't covered here, it may be in the general Bitsy FAQ.

For other issues, feel free to ping me, open an issue, or ask for help on the Bitsy discord!

Old Versions

Bitsy and the hacks are generally not backwards-compatible: when Bitsy updates, it often breaks individual hacks. If you're having issues with hacks after a Bitsy update, it's possible they are out of date. Feel free to reach out for help or open an issue if you suspect this is the case.

If you are using an older version of Bitsy (or a fork based on an older version), you may require old versions of the hacks. Support is not guaranteed across versions, and old versions are not maintained, but some helpful points in history are listed below.

Further reading