Warcraft III-vibes, narrazione attualissima, che dire: leggendario (arancione).

Fahien
Creator of
Recent community posts
Grazie! L’interfaccia su smartphone e’ merito dell’emulatore https://github.com/binji/binjgb
Space Float
Another month compressed in an archive.
Source code
If you want to look at the code, here is the repository on github.
Conclusion
Well, enjoy the game and tell us your opinions. If you like, you can vote for our entry at this link.
I would thank
pasto for this outstanding month.
I leave with the last devlog.
Audio
The reproduction of sound effects in Space Float is performed via the singleton enum Audio. It has the attributes float volume and boolean mute, useful to manage audio centrally.
Through the methods play(Sound) and play(Sound, float) you can play sounds, respectively at default or specific volume.
private float volume = 1.0f;
private boolean mute = false;
public void play(Sound sound) {
play(sound, volume);
}
public void play(Sound sound, float volume) {
if (!mute) sound.play(volume);
}
If necessary, it is possible to loop a sound effect through the method loop(Sound) and stop playback through the method stop(Sound).
public void stop(Sound sound) {
sound.stop();
}
public void loop(Sound sound) {
if (!mute) sound.loop();
}The Game Screen
You could find a better formatted version of this devlog at this link
The Game Screen is the most important of SpaceFloat because it shows the 3D world with which the player can interact. It makes use of the powerful Ashley Engine that helps significantly reduce the complexity of the system.
This Screen creates all the systems it needs within its constructor.
private ReactorController reactorController;
private BulletSystem bulletSystem;
private CameraSystem cameraSystem;
private RenderSystem renderSystem;
public GameScreen() {
reactorController = new ReactorController();
bulletSystem = new BulletSystem();
cameraSystem = new CameraSystem();
renderSystem = new RenderSystem();
}
Like all SpaceFloat Screens, when the show method is called, all the Game Screen dependencies have already been initialized, so it can inject the last dependencies into the systems, add these systems to the Engine and finally create the HUD.
@Override
public void show() {
injectSystemsDependencies();
addSystemsToEngine(getEngine());
createHud(getStage());
}
private void injectSystemsDependencies() {
Camera mainCamera = getCamera();
cameraSystem.setCamera(mainCamera);
renderSystem.setCamera(mainCamera);
ParticleSystem particleSystem = getParticleSystem();
reactorController.setParticleSystem(particleSystem);
renderSystem.setParticleSystem(particleSystem);
}
private void addSystemsToEngine(Engine engine) {
engine.addSystem(reactorController);
engine.addSystem(bulletSystem);
engine.addSystem(cameraSystem);
engine.addSystem(renderSystem);
}
public void createHud(Stage stage) {
HudFactory factory = new HudFactory();
stage.addActor(factory.getFpsActor());
stage.addActor(factory.getVelocityActor());
stage.addActor(factory.getAccelerationActor());
stage.addActor(factory.getEnergyActor());
}
Eventually, the update method becomes nothing more simple:
@Override
public void update(float delta) {
super(delta);
engine.update(delta);
}
To follow the pattern of previous posts, I conclude with an image of the HUD elements!
The Loading Screen
You could find a better formatted version of this devlog at this link
A fundamental use case of the asset manager is in the LoadingScreen. With this tecnique you can load all assets within a directory while showing progress.
public class LoadingScreen extends SpaceFloatScreen {
private static final String TEXTURE_DIRECTORY = "textures/";
private AssetManager assetManager;
private float progress;
@Override
public void show() {
super.show();
assetManager = getAssetManager();
FileHandle[] files = Gdx.files.local(TEXTURE_DIRECTORY).list();
for(FileHandle file : files) {
assetManager.load(file.path(), Texture.class);
}
}
@Override
public void render(float delta) {
assetManager.update();
progress = assetManager.getProgress();
logger.info("Loading assets: " + progress);
if (progress < 1.0f) return;
SpaceFloat.GAME.setScreen(ScreenEnumerator.MAIN);
}
}
I'm also glad to show you the new cargoship which you drive in SpaceFloat!
SpaceFloat Asset Management
SpaceFloat uses an instance of the AssetManager provided by libGDX to manage assets. This instance follow the lifecycle of the SpaceFloatGame instance and it is injected into the Screens as a dependence.
public class SpaceFloatGame extends Game {
private AssetManager assetManager;
public SpaceFloatGame() {
assetManager = new AssetManager();
}
// ...
@Override
public void dispose() {
assetManager.dispose();
}
}
I will show you a fundamental use case in the next devlog presenting the LoadingScreen.




