Quote:
Originally Posted by Ether
Yes, thank you, that is what I was asking originally.
|
Apologies, here you go.
Code:
public class ShootCommand extends Command {
public void initialize() {
logic for fire1;
}
public void execute() {
}
public boolean isFinished() {
return timeSinceInitialized() > 1;
}
public void end() {
logic for fire 2;
}
}
1. Run fire1 logic when command starts.
2. Do nothing for 1 second.
3. After 1 second return true in isFinished().
4. When isFinished() returns true the end() method is called.
5. Run logic for fire2 in end.
Keep in mind, the logic for both fire1 and fire2 will need to execute quickly. Meaning no Timer.delays or long running loops.