From: Ben Morrow Date: Sun, 18 Aug 2013 01:56:18 +0000 (-0700) Subject: Now make it move X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=27e9754c8f288b83c4c100e6030fb30190a2e0a2;p=SugarCubes.git Now make it move --- diff --git a/BenMorrow.pde b/BenMorrow.pde index a86189b..67a1b79 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -49,7 +49,16 @@ class GranimTestPattern extends GranimPattern { super(glucose); RedThreeGraphic myReds = new RedThreeGraphic(); - addGraphic("string_name",myReds); + addGraphic("myThreeReds",myReds); + } + int counter=0; + public void run(int deltaMs) + { + super.run(deltaMs); + if(counter % 3 ==0) + { + getGraphicByName("myThreeReds").position++; + } } diff --git a/GranimPattern.pde b/GranimPattern.pde index 2fd33e1..99d8f40 100644 --- a/GranimPattern.pde +++ b/GranimPattern.pde @@ -26,6 +26,11 @@ class GranimPattern extends SCPattern displayList.put(name,g); } + public Graphic getGraphicByName(String name) + { + return displayList.get(name); + } + public void run(int deltaMs) { for(Graphic g : displayList.values())