Skip to content

Commit

Permalink
Starship
Browse files Browse the repository at this point in the history
Finished startship
  • Loading branch information
rsammelson committed Mar 25, 2017
1 parent 99c8ffb commit 44f371c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Run_Bling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void runBling (int order[]) {
Reset();
case 12:
brightOver(BRIGHT - 20);
audioBar(2000, 4);
audioBar(2500, 5);
Reset();
break;
}
Expand Down
27 changes: 17 additions & 10 deletions Starship.ino
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
void explodingCircle (int x, int y, int r, uint16_t color) {
<<<<<<< HEAD
// matrix.fillCircle(x, y, r);
}

void drawShip (int x, int y, float s, uint16_t color) {
void drawShipTL (int x, int y, float s, uint16_t color) {
// Left side
matrix.drawLine(x, y, round(x + s), y, color);
// long
matrix.drawLine(x, y, x, round(y + (4 * s)), color);
matrix.drawLine(x, round(y + (4 * s)), round(x + s), round(y + (4 * s)), color);

// Middle
int rX = x + (10 * s);
int rY = round((y + (4 * s)) / 2.0);
matrix.drawLine(x, round((y + (4 * s)) / 2.0), rX, rY, color);
// matrix.fillCircle();
int rY = round(round(y + (4 * s)) / 2.0);
matrix.drawLine(x, rY, rX, rY, color);
matrix.fillCircle((round((rX - x) / 2.0) + x), rY, (s * 2), color);

// Right side
// long
matrix.drawLine(rX, y, rX, round(y + (4 * s)), color);
matrix.drawLine(rX, y, rX - s, y, color);
matrix.drawLine(rX, round(y + (4 * s)), rX - s, round(y + (4 * s)), color);

updateScreen();
=======
matrix.fillCircle(x, y, r);
}

void drawShip (int x, int y, float s) {
matrix.drawLine();
>>>>>>> master
void drawShip (int x, int y, float s, uint16_t color) {
int X = x;
int Y = y;
X += 5 * s;
Y += round(round(y + (4 * s)) / 2.0);
drawShipTL (X, Y, s, color);
}

17 changes: 10 additions & 7 deletions _0-_Main_Bling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define NUMBER 2 // number high

#define PROGS 13 // programs that exist
#define ToRUN 11 // # to run (if oneOfEach is false) (if true, must equal number of progams being run)
#define ToRUN 10 // # to run (if oneOfEach is false) (if true, must equal number of progams being run)
const bool oneOfEach = true;

#define OVER true
Expand Down Expand Up @@ -86,7 +86,7 @@ int firstLogoW;

// // one of each true (false)
// 0 1 2 3 4 5 6 7 8 9 10 11 12
int progLimit[PROGS] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; // Limit for each program (or ratio)
int progLimit[PROGS] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1}; // Limit for each program (or ratio)
int progRuns[PROGS]; // Number of times each has been selected (nothing)
int blingPrograms[ToRUN]; // order

Expand Down Expand Up @@ -182,7 +182,7 @@ void loop() {
// Reset();
// delay(1000);

bling();
// bling();

// sinWaveM(matrix.Color(255, 255, 255), 0, 2500, 25, 2);
// Reset();
Expand All @@ -202,10 +202,13 @@ void loop() {
// Reset();
// delay(2500);

// drawShip(1, 1, 1, WHITE);
// delay(10000);
// Reset();
// delay(1000);
for (float i = 0; i <= 3; i += 0.1) {
drawShip(20, 8, i, WHITE);
matrix.clear();
}
delay(2500);
Reset();
delay(500);
}

void bling () {
Expand Down

1 comment on commit 44f371c

@rsammelson
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit added is a final version of the starship, other than #2.

Please sign in to comment.