| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ASE - a sprite editor for Arduboy games that runs on the Arduboy.
Example of Drawing Screen:
Example of Sub-Menu Screen:
The screen is divided into 4 parts:
Here is a complete code example starting with a saved sprite copied from the Arduino serial monitor output:
const unsigned char PROGMEM sprite_and_mask[] = {
// For load, cut and paste between START and END, and send over serial port
// then choose LOAD WITH MASK
// START
16,16,
0x78,0xF8,0x8C,0xFC,0xE4,0xFC,0xF6,0xFE,0xA2,0xFE,0x5B,0xFF,0xA9,0xFF,0x15,0xFF,0x0D,0xFF,0x15,0xFF,0xAD,0xFF,0x59,0xFF,0xAA,0xFE,0xF2,0xFE,0x44,0xFC,0x18,0xF8,0x03,0x03,0x06,0x07,0x05,0x07,0x0D,0x0F,0x0A,0x0F,0x1B,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x17,0x1F,0x1A,0x1F,0x0D,0x0F,0x06,0x07,0x03,0x03,
0x78,0xF8,0xBC,0xFC,0xDC,0xFC,0xEE,0xFE,0xAE,0xFE,0x57,0xFF,0xA7,0xFF,0x17,0xFF,0x07,0xFF,0x17,0xFF,0xA7,0xFF,0x57,0xFF,0xAE,0xFE,0xEE,0xFE,0x5C,0xFC,0x18,0xF8,0x03,0x03,0x06,0x07,0x05,0x07,0x0D,0x0F,0x0A,0x0F,0x1B,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x17,0x1F,0x1A,0x1F,0x0D,0x0F,0x06,0x07,0x03,0x03,
0xF8,0xF8,0xFC,0xFC,0x7C,0xFC,0x7E,0xFE,0xBE,0xFE,0x3F,0xFF,0xBF,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0xBF,0xFF,0x3F,0xFF,0xBE,0xFE,0xBE,0xBE,0x3C,0xBC,0xF8,0xF8,0x03,0x03,0x06,0x07,0x05,0x07,0x0D,0x0F,0x0A,0x0F,0x1B,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x15,0x1F,0x16,0x1F,0x17,0x1F,0x1A,0x1F,0x0D,0x0F,0x06,0x07,0x03,0x03,
0xF8,0xF8,0xFC,0xFC,0xFC,0xFC,0xFE,0xFE,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFE,0xFE,0xFC,0xFC,0x78,0xF8,0x02,0x03,0x06,0x07,0x05,0x07,0x0D,0x0F,0x0B,0x0F,0x1B,0x1F,0x17,0x1F,0x17,0x1F,0x17,0x1F,0x17,0x1F,0x17,0x1F,0x17,0x1F,0x1B,0x1F,0x0D,0x0F,0x06,0x07,0x03,0x03
// END
};
#include <Arduboy2.h>
#include <Sprites.h>
Arduboy2 arduboy;
Sprites sprites;
uint8_t sequence = 100;
void setup() {
arduboy.begin();
arduboy.setFrameRate(30);
}
void loop() {
if (!(arduboy.nextFrame())) return;
arduboy.fillScreen(WHITE);
uint8_t frame = sequence < 4 ? sequence : sequence < 7 ? 7 - sequence : 0;
if (sequence-- == 0) sequence = random(10,100);
sprites.drawPlusMask((WIDTH-16)/2-12,(HEIGHT-16)/2,sprite_and_mask,frame);
sprites.drawPlusMask((WIDTH-16)/2+12,(HEIGHT-16)/2,sprite_and_mask,frame);
arduboy.display();
}| Back | FazBrowse Home | New Git URL |