Skip to content

Commit

Permalink
Fixed starship bug
Browse files Browse the repository at this point in the history
Starship is connected
Draw ship bug fixed
	draws from middle
  • Loading branch information
rsammelson committed Mar 25, 2017
1 parent 44f371c commit 32b3f11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions Starship.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ void drawShipTL (int x, int y, float s, uint16_t 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(round(y + (4 * s)) / 2.0);
int rX = x + (9 * s);
int rY = round(y + round((4 * s) / 2.0));
// int mY = round(y / 2.0);
matrix.drawLine(x, rY, rX, rY, color);
matrix.fillCircle((round((rX - x) / 2.0) + x), rY, (s * 2), color);

Expand All @@ -27,8 +28,8 @@ void drawShipTL (int x, int y, float s, uint16_t color) {
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);
X -= round(4.5 * s);
Y -= round((round(y + (4 * s)) - y) / 2.0);
drawShipTL (X, Y, s, color);
}

7 changes: 5 additions & 2 deletions _0-_Main_Bling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ void loop() {
// Reset();
// delay(2500);

for (float i = 0; i <= 3; i += 0.1) {
drawShip(20, 8, i, WHITE);

// drawShip(20, 7, 2, WHITE);

for (float i = 0; i <= 2; i += 0.1) {
drawShip(20, 7, i, WHITE);
matrix.clear();
}
delay(2500);
Expand Down

0 comments on commit 32b3f11

Please sign in to comment.