First implementation of stasis field

This commit is contained in:
=
2017-10-31 17:45:17 +01:00
parent f756e1d939
commit 623abdc271
7 changed files with 120 additions and 67 deletions

View File

@ -0,0 +1,47 @@
package de.frajul.endlessroll.entities.tools;
import de.frajul.endlessroll.data.Vector;
import de.frajul.endlessroll.entities.DestroyEffect;
import de.frajul.endlessroll.entities.Player;
import de.frajul.endlessroll.entities.collision.geometry.Circle;
import de.frajul.endlessroll.entities.collision.geometry.Geometry;
import de.frajul.endlessroll.entities.particles.ParticleSource;
import de.frajul.endlessroll.entities.particles.ParticleSystem;
import de.frajul.endlessroll.main.game.Timer;
/**
* Created by Julian on 11.02.2016.
*/
public class Stasis extends Tool {
private ParticleSource particleSource;
public Stasis(Vector position, ParticleSystem particleSystem) {
super(ToolType.STASIS, position, .6f * ToolType.STASIS.getCurrentUpgradeValue(ToolUpgradeType.SIZE) / 100, .6f * ToolType.STASIS.getCurrentUpgradeValue(ToolUpgradeType.SIZE) / 100, false, false);
animation.disable();
super.setFloating(true);
particleSource = new ParticleSource(new Vector(position), particleSystem.magnet);
particleSource.start();
}
@Override
public void destroy(DestroyEffect destroyEffect) {
super.destroy(destroyEffect);
particleSource.kill();
}
@Override
public void onPlayerCollision(Player player, Timer timer) {
player.getMovement().setY(0);
}
@Override
protected Geometry createWorldCollisionBounds() {
return this;
}
@Override
protected Geometry createPlayerCollisionBounds() {
return this;
}
}

View File

@ -6,6 +6,6 @@ package de.frajul.endlessroll.entities.tools;
public enum ToolUpgradeType {
COOLDOWN, DURATION, FORCE, RANGE;
COOLDOWN, DURATION, FORCE, RANGE, SIZE;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -74,12 +74,14 @@
<string name="tool_description_magnet">Difficult to handle, but if you master it you can do anything</string>
<string name="tool_description_bomb">Blow up all obstacles near the bomb</string>
<string name="tool_description_power_mushroom">This will give you super-powers for a few seconds</string>
<string name="tool_description_stasis">Freezes a certain area which leads to longer in-air time</string>
<string name="tool_name_locked">\?\?\?</string>
<string name="tool_name_ramp">Ramp</string>
<string name="tool_name_spring">Spring</string>
<string name="tool_name_magnet">Magnet</string>
<string name="tool_name_bomb">Bomb</string>
<string name="tool_name_power_mushroom">Mushroom</string>
<string name="tool_name_stasis">Stasis</string>
<string name="tool_level_format_d">Level: %d</string>
<string name="tool_upgrade_title_format_sd">%1$s (Lv%2$d)</string>
<string name="tool_upgrade_none">None</string>