package com.codebynumber.java3d.breakout; // TimeBehavior.java // Andrew Davison, April 2005, ad@fivedots.coe.psu.ac.th /* Update the alien sprite every timeDelay ms by calling its update() method. This class is the Java 3D version of a Timer. */ import java.util.Enumeration; import javax.media.j3d.*; public class TimeBehavior extends Behavior { private WakeupCondition timeOut; private Ball ball; public TimeBehavior(int timeDelay, Ball b) { ball = b; timeOut = new WakeupOnElapsedTime(timeDelay); } public void initialize() { wakeupOn( timeOut ); } public void processStimulus( Enumeration criteria ) { // ignore criteria ball.update(); wakeupOn( timeOut ); } // end of processStimulus() } // end of TimeBehavior class