mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-21 12:08:34 +07:00
Minor tweaks
This commit is contained in:
parent
b369751a75
commit
f063f7b2d3
@ -14,15 +14,12 @@ import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
/** Controls playback of multiple music tracks.*/
|
||||
public class MusicControl{
|
||||
private static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.45f, musicWaveChance = 0.35f;
|
||||
private static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.5f, musicWaveChance = 0.4f;
|
||||
|
||||
/** normal, ambient music, plays at any time */
|
||||
public final Array<Music> ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6);
|
||||
/** darker music, used in times of conflict */
|
||||
public final Array<Music> darkMusic = Array.with(Musics.game2, Musics.game5, Musics.game7);
|
||||
/** all music, both dark and ambient */
|
||||
public final Array<Music> allMusic = Array.withArrays(ambientMusic, darkMusic);
|
||||
|
||||
private Music lastRandomPlayed;
|
||||
private Interval timer = new Interval();
|
||||
private @Nullable Music current;
|
||||
@ -88,7 +85,7 @@ public class MusicControl{
|
||||
}
|
||||
|
||||
//dark based on enemies
|
||||
return Mathf.chance(state.enemies() / 70f);
|
||||
return Mathf.chance(state.enemies() / 70f + 0.1f);
|
||||
}
|
||||
|
||||
/** Plays and fades in a music track. This must be called every frame.
|
||||
|
@ -33,7 +33,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
|
||||
//gesture data
|
||||
private Vector2 vector = new Vector2();
|
||||
private float lastDistance = -1f;
|
||||
private float lastDistance = -1f, lastZoom;
|
||||
|
||||
/** Position where the player started dragging a line. */
|
||||
private int lineStartX, lineStartY;
|
||||
@ -469,6 +469,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
|
||||
@Override
|
||||
public boolean touchUp(int screenX, int screenY, int pointer, KeyCode button){
|
||||
lastZoom = renderer.getScale();
|
||||
|
||||
//place down a line if in line mode
|
||||
if(lineMode){
|
||||
@ -728,11 +729,8 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
@Override
|
||||
public boolean zoom(float initialDistance, float distance){
|
||||
if(Core.settings.getBool("keyboard")) return false;
|
||||
if(lastDistance == -1) lastDistance = initialDistance;
|
||||
|
||||
float amount = (Mathf.sign(distance > lastDistance) * 0.04f) * Time.delta();
|
||||
renderer.scaleCamera(UnitScl.dp.scl(amount));
|
||||
lastDistance = distance;
|
||||
renderer.setScale(distance / initialDistance * lastZoom);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user