• R/O
  • SSH

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-c誰得cocoaqtpythonrubywindowsphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Révisionc4f31fb8f35351dd8755704a00bf9ca634b07837 (tree)
l'heure2021-09-16 00:22:54
Auteursebastian_bugiu
Commitersebastian_bugiu

Message de Log

Added vibration for cargo ship explosion.

Change Summary

Modification

diff -r 1a360bee2d59 -r c4f31fb8f353 core/src/headwayent/blackholedarksun/APP_Game.java
--- a/core/src/headwayent/blackholedarksun/APP_Game.java Mon Sep 13 21:01:12 2021 +0300
+++ b/core/src/headwayent/blackholedarksun/APP_Game.java Wed Sep 15 18:22:54 2021 +0300
@@ -1400,7 +1400,8 @@
14001400 ADVANCE_WEAPON(150, Input.VibrationStyle.TRANSIENT),
14011401 ADVANCE_SELECTION(150, Input.VibrationStyle.TRANSIENT),
14021402 PLAYER_FIRE_WEAPON(250, Input.VibrationStyle.CONTINUOUS),
1403- HOMING_BEEP(300, Input.VibrationStyle.CONTINUOUS);
1403+ HOMING_BEEP(300, Input.VibrationStyle.CONTINUOUS),
1404+ CARGO_SHIP_EXPLOSION(4000, Input.VibrationStyle.CONTINUOUS);
14041405
14051406 private final int duration;
14061407 private final com.badlogic.gdx.Input.VibrationStyle vibrationStyle;
diff -r 1a360bee2d59 -r c4f31fb8f353 core/src/headwayent/blackholedarksun/animations/CargoShipExplosionAnimation.java
--- a/core/src/headwayent/blackholedarksun/animations/CargoShipExplosionAnimation.java Mon Sep 13 21:01:12 2021 +0300
+++ b/core/src/headwayent/blackholedarksun/animations/CargoShipExplosionAnimation.java Wed Sep 15 18:22:54 2021 +0300
@@ -5,6 +5,8 @@
55 import java.util.ArrayList;
66
77 import headwayent.blackholedarksun.APP_Game;
8+import headwayent.blackholedarksun.MainApp;
9+import headwayent.blackholedarksun.components.EntityProperties;
810 import headwayent.blackholedarksun.components.ShipProperties;
911 import headwayent.blackholedarksun.compositor.SceneCompositor;
1012 import headwayent.blackholedarksun.gamestatedebugger.FrameInterval;
@@ -27,6 +29,7 @@
2729 private static final String EXPLOSION_SMALL_MAT = "explosion_small_mat";
2830 private static final String WHITENED_MAT = "whitened_screen_mat";
2931 private static final int NUM_SMALL_EXPLOSIONS = 32;
32+ public static final float MAX_SOUND_DISTANCE = 3500.0f;
3033
3134 private Entity shipEntity;
3235 private ShipProperties shipProperties;
@@ -70,6 +73,19 @@
7073 createBillboard(sceneManager);
7174 createSmallBillboard(sceneManager);
7275 SceneCompositor.getSingleton().addColoredCompositor(SceneCompositor.CompositorColor.WHITE, SceneCompositor.whiteCompositorId, TOTAL_ANIM_TIME);
76+ WorldManager worldManager = WorldManager.getSingleton();
77+ Entity playerShip = worldManager.getPlayerShip();
78+ if (playerShip != null) {
79+ EntityProperties entityProperties = worldManager.getEntityPropertiesComponentMapper().get(playerShip);
80+ if (!entityProperties.isDestroyed()) {
81+ ENG_Vector4D playerShipPosition = entityProperties.getNode().getPosition();
82+ EntityProperties cargoEntityProperties = worldManager.getEntityPropertiesComponentMapper().get(shipEntity);
83+ ENG_Vector4D cargoPosition = cargoEntityProperties.getNode().getPosition();
84+ if (playerShipPosition.distance(cargoPosition) < MAX_SOUND_DISTANCE) {
85+ MainApp.getGame().vibrate(APP_Game.VibrationEvent.CARGO_SHIP_EXPLOSION);
86+ }
87+ }
88+ }
7389 super.start();
7490 }
7591