From 891b71c261a4571e0e0ba0e824e1bdb2478e0c65 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 19 Nov 2012 21:05:27 +0000 Subject: flake animations --- vfg/src/music.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'vfg/src/music.h') diff --git a/vfg/src/music.h b/vfg/src/music.h index aaec003..96c8e1d 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -2,6 +2,7 @@ #include "ofMain.h" #include "ofxXmlSettings.h" +#include "Puppet.h" //event times are absolute integer milliseconds //--------------------------------------------------------------------------------------------------------------------------------------------- @@ -57,13 +58,26 @@ class note { num=n; velocity=v; duration=d; - activated=false; } int num; int velocity; int duration; //may be needed another time? +}; +//--------------------------------------------------------------------------------------------------------------------------------------------- +class flake: public note { + public: + flake(int n,int v,int d=0) : note(n,v,d) { activated=false; } + Puppet puppet; bool activated; - void activate() { activated=true; } + void activate() { + activated=true; + puppet.play("shatter"); + } + void draw(float x, float y) { + if (!activated||puppet.isPlaying()) puppet.draw(x,y); + } + bool disintegrated; + void disintegrate() { disintegrated=true; } }; //--------------------------------------------------------------------------------------------------------------------------------------------- class lyric { @@ -136,10 +150,12 @@ class musicscore: public score { private: map notes; - map flakes; - int timeframe; - ofImage flake; + map flakes; + int timeframe; float nowpoint; + + vector snowflakes; + }; //--------------------------------------------------------------------------------------------------------------------------------------------- class song { -- cgit v1.2.3