Game Development Reference
In-Depth Information
if(i > 0){
i--;
}
}
8. Create a fire() method that creates a new bullet by using the camera's location
and direction as follows:
bullets.add(new Bullet(cam.getLocation().clone(),
cam.getDirection().clone()));
9. The method is called from the InputAppState's onAction method, which is sim-
ilar to how it looked in the previous recipe:
if (isPressed && character.getCooldown() == 0f){
((CharacterInputTest_Firing_NonInstant) app
).fire();
character.onFire();
}
Search WWH ::




Custom Search