From 27e9754c8f288b83c4c100e6030fb30190a2e0a2 Mon Sep 17 00:00:00 2001 From: Ben Morrow Date: Sat, 17 Aug 2013 18:56:18 -0700 Subject: [PATCH] Now make it move --- BenMorrow.pde | 11 ++++++++++- GranimPattern.pde | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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()) -- 2.34.1