// Hypnotizing santa int HS_HYPNO = 0; int HS_TALK = 1; int HS_IDLE = 2; int HS_IDLE_PHASE = -1; int HS_GREET_PHASE = 0; int HS_HYPNO_PHASE = 1; int HS_LEAVING_PHASE = 2; int HS_RESPOND_PHASE = 3; class HypnoSanta { int state; float xpos, ypos; boolean flip; Animation hypno, talk, idle; int frame; int lastTime = 0; // String[] hypnoPhrases; int gamePhase = HS_IDLE_PHASE; int phaseTime = 0; String textBuf = ""; HypnoSanta(float x, float y, int time, boolean f) { lastTime = time; frame = 0; xpos = x; ypos = y; flip = f; state = HS_IDLE; hypno = loadAnimation("santa_hypno"); idle = loadAnimation("santa_idle2"); talk = loadAnimation("santa_talk"); } void Hypno() { state = HS_HYPNO; } void Idle() { state = HS_IDLE; } void Talk() { state = HS_TALK; } int Draw(int time, int s) // returns state { if (state == HS_HYPNO) { hypno.display(xpos,ypos,time,true,s,flip); } if (state == HS_IDLE) { idle.display(xpos,ypos,time,true,s,flip); } if (state == HS_TALK) { talk.display(xpos,ypos,time,true,s,flip); } lastTime = time; return state; } }