All Projects → gjtorikian → Earthbound Battle Backgrounds Js

gjtorikian / Earthbound Battle Backgrounds Js

Licence: mit
A JavaScript project that generates all the Earthbound/Mother 2 backgrounds.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Earthbound Battle Backgrounds Js

pikaso
Seamless and headless HTML5 Canvas library
Stars: ✭ 23 (-91.09%)
Mutual labels:  canvas
audio-oscilloscope
Audio oscilloscope in canvas.
Stars: ✭ 28 (-89.15%)
Mutual labels:  canvas
Photoeditor
A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
Stars: ✭ 3,105 (+1103.49%)
Mutual labels:  canvas
ux-charts
Simple, responsive, modern Charts with zero dependencies
Stars: ✭ 22 (-91.47%)
Mutual labels:  canvas
repeat-editor
editor for live coding graphics
Stars: ✭ 17 (-93.41%)
Mutual labels:  canvas
jqCandlestick
jQuery plugin for creating line, bar and candlestick charts.
Stars: ✭ 13 (-94.96%)
Mutual labels:  canvas
react-starfield-animation
✨ Canvas-based starfield animation for React.
Stars: ✭ 82 (-68.22%)
Mutual labels:  canvas
Flutter Canvas
About using of canvas in the flutter
Stars: ✭ 259 (+0.39%)
Mutual labels:  canvas
Spotify-Cards-API
🚀 Unofficial Spotify PromoCards API
Stars: ✭ 13 (-94.96%)
Mutual labels:  canvas
Isomer
Isomer is an easy-to-use graphics library for drawing isometric scenes.
Stars: ✭ 2,767 (+972.48%)
Mutual labels:  canvas
Ananas
An easy image editor integration for your Android apps.
Stars: ✭ 186 (-27.91%)
Mutual labels:  canvas
canvas-color-tracker
A utility to track objects on a canvas by unique px color
Stars: ✭ 29 (-88.76%)
Mutual labels:  canvas
UltraTypeBot
A fast, easy to use bot for NitroType.com
Stars: ✭ 24 (-90.7%)
Mutual labels:  canvas
js-confetti
JS Confetti library that supports emojis 🦄 🎉 ⚡️
Stars: ✭ 343 (+32.95%)
Mutual labels:  canvas
Canvg
Javascript SVG parser and renderer on Canvas
Stars: ✭ 2,963 (+1048.45%)
Mutual labels:  canvas
d3-canvas-transition
transition on canvas with d3
Stars: ✭ 19 (-92.64%)
Mutual labels:  canvas
Pancake
Lightweight, Fast, Easy-to-use HTML5 2D game framework!
Stars: ✭ 79 (-69.38%)
Mutual labels:  canvas
Zimjs
ZIM JavaScript Canvas Framework - Code Creativity! Interactive Media For All.
Stars: ✭ 259 (+0.39%)
Mutual labels:  canvas
Front Ui
😄 🎨 Collect some front-end special effects (收集一些前端特效)
Stars: ✭ 259 (+0.39%)
Mutual labels:  canvas
Simple Draw
A canvas you can draw on with different colors.
Stars: ✭ 256 (-0.78%)
Mutual labels:  canvas

Earthbound Battle Backgrounds JS

Earthbound Battle Background JS is exactly what its name implies: the battle backgrounds from the SNES RPG Earthbound/Mother 2, rendered entirely in client-side JavaScript.

If you like this project, you might also like the Earthbound Battle Backgrounds Live Wallpaper, which is a Java/Android implementation.

How it works

Every battle background is composed of two layers, each with 327 possible styles (including "blank"/zero). The layer styles can be interchanged, such that Layer 1: 50 and Layer 2: 300 is the same as Layer 1: 300 and Layer 2: 50. Thus, there are C(n,r) = 52,650 possible different background combinations. Obviously, this many don't exist in the game--the SNES's graphical capabilities only allow it to properly render 3,176 of these combinations, and of those, only 225 are ever used.

The data for each of the 327 styles is bundled within the SNES cartridge. Tiles are constructed from various memory addresses in Earthbound game data. To create the distortion effect, the following function is used:

Offset (y, t) = A sin ( F*y + S*t )

where:

  • y is the vertical coordinate being transformed
  • t is time that's elapsed
  • A is the amplitude
  • F is the frequency
  • S is the speed or frameskip of the transformation

Offest refers to the y direction of the shift at a given time t.

There are also three types of distortions that use the result of the Offset function:

  • Horizontal translations, where each line is shifted left by the given number of pixels
  • Horizontal interlaced translations, where every other line is shifted right by the given number of pixels
  • Vertical compression translations, where each line is shifted up or down by the given number of pixels

Different backgrounds use different distortion effects.

List of backgrounds

It's pretty damn hard to find out which battle backgrounds correspond to which enemies. You can review the list of enemies matched with known battle backgrounds to try and get your favorite on the Suggested Layers option. If you discover a new one, please, email me and I'll add it to the list, giving you full credit!

Running locally

Make sure you have Node.js and NPM on your system. Then:

npm install
npm run watch
npm start
open http://localhost:8888

Note that this code runs entirely in the browser! Node is only used to start an Express server.

License

This app is in no way endorsed or affiliated by Nintendo, Ape, HAL Laboratory, Shigesato Itoi, etc. It's licensed under MIT.

Credits

I am entirely indebted to Mr. Accident of forum.starmen.net for the original battle background generation code, which was a C# project that uses the battle backgrounds as Windows screensavers. He also provided me with help along the way, and as far as I'm aware, he discovered the math behind it all, including the entire Offset function calculation. This port would be nothing without him.

In 2016, @kdex rewrote much of my shitty JS into nice and clean ES2016 code, for which I am grateful. As of dc877f33, the entirety of his modifications have been brought over here.

Additionally, everyone who worked on PK Hack or was even associated with the project. It's incredible to witness such a powerful community of fans who have turned a wonderful game inside-out over and over again.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].