From 6131f4d269ab49b56a80a1337678a77e040d5be0 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 6 Nov 2011 21:14:53 +0100 Subject: =?UTF-8?q?leicht=20ver=C3=A4nderte=20schnecke,=20zuf=C3=A4llige?= =?UTF-8?q?=20schneckenstartpunkte+=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Matrix_5x6/Charlie/Charlie.pde | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Matrix_5x6') diff --git a/Matrix_5x6/Charlie/Charlie.pde b/Matrix_5x6/Charlie/Charlie.pde index d863a03..fa7f4a0 100644 --- a/Matrix_5x6/Charlie/Charlie.pde +++ b/Matrix_5x6/Charlie/Charlie.pde @@ -1,5 +1,11 @@ #include +/* TODO: + * Laufschrift + * Ameise + * Game of Life + */ + #define NUMBER_OF_PINS 6 byte pins[] = {2,3,4,5,6,7}; Charlieplex charlieplex = Charlieplex(pins,NUMBER_OF_PINS); @@ -118,10 +124,13 @@ void schnecke(int s) { break; } + int i; + i = 0; while (1) { + i++; if (scr[x][y]) break; - scr[x][y] = 20; + scr[x][y] = w?20:i+5; drawscr(2); fadescr_down(); @@ -139,7 +148,8 @@ void schnecke(int s) { case 3: y--; break; } } - int i = 20; + + i = 20; while(i--) { fadescr_down(); drawscr(2); @@ -149,8 +159,5 @@ void schnecke(int s) { void loop() { // zufall_fading_up(); // zufall_fading_down(); - schnecke(0); - schnecke(1); - schnecke(2); - schnecke(3); + schnecke(random(4)); } -- cgit v1.2.3