Changed particle effects
Message renamed to GameOverMessage + improved look Added first implementation of GoalScreen Cleaned up and improved look of levelButton, worldButton and their screens
This commit is contained in:
@ -15,8 +15,8 @@ public class Stasis extends PlayerInfluenceTool {
|
||||
|
||||
private ParticleSource particleSource;
|
||||
private boolean firstCollision = true;
|
||||
private final static float Y_SLOW_FACTOR = .2f;
|
||||
private final static float X_SLOW_FACTOR = .8f;
|
||||
private final static float Y_SLOW_FACTOR = .4f; //Final .2f
|
||||
private final static float X_SLOW_FACTOR = .9f; //Final .8f
|
||||
|
||||
public Stasis(Vector position, ParticleSystem particleSystem) {
|
||||
super(ToolType.STASIS, position,
|
||||
@ -27,7 +27,8 @@ public class Stasis extends PlayerInfluenceTool {
|
||||
animation.setRequiredDelta(300);
|
||||
animation.setIndexSequence(new int[]{1, 1, 2, 3, 2, 4, 4, 3, 2, 2, 3, 3});
|
||||
super.setFloating(true);
|
||||
particleSource = new ParticleSource(new Vector(position), particleSystem.magnet);
|
||||
particleSource = new ParticleSource(new Vector(position), particleSystem.stasis);
|
||||
particleSource.setSpawnSize(new Vector(super.width, super.height));
|
||||
particleSource.start();
|
||||
}
|
||||
|
||||
@ -54,10 +55,12 @@ public class Stasis extends PlayerInfluenceTool {
|
||||
|
||||
@Override
|
||||
public void influencePlayerValues(Player player) {
|
||||
player.manipulateAllForces(Y_SLOW_FACTOR);
|
||||
player.getMovement().setX(player.getMovement().getX() * .8f);
|
||||
float forceValue = ToolType.STASIS.getCurrentUpgradeValue(ToolUpgradeType.FORCE);
|
||||
float finalXSlow = X_SLOW_FACTOR - forceValue / 20f;
|
||||
player.manipulateAllForces(Y_SLOW_FACTOR / forceValue);
|
||||
player.getMovement().setX(player.getMovement().getX() * finalXSlow);
|
||||
if (firstCollision) {
|
||||
player.getMovement().y *= Y_SLOW_FACTOR;
|
||||
player.getMovement().y *= Y_SLOW_FACTOR / forceValue;
|
||||
firstCollision = false;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,60 @@
|
||||
package de.frajul.endlessroll.main.screens;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import de.frajul.endlessroll.R;
|
||||
import de.frajul.endlessroll.levels.Level;
|
||||
import de.frajul.endlessroll.levels.LevelPack;
|
||||
import de.frajul.endlessroll.main.GameActivity;
|
||||
import de.frajul.endlessroll.main.game.Game;
|
||||
import de.frajul.endlessroll.views.LevelButton;
|
||||
import de.frajul.endlessroll.views.LevelButtonOnClickListener;
|
||||
import de.frajul.endlessroll.views.TopBar;
|
||||
|
||||
/**
|
||||
* Created by Julian on 23.04.2016.
|
||||
*/
|
||||
public class GoalScreen extends Screen<LinearLayout> implements LevelButtonOnClickListener {
|
||||
|
||||
private LevelPack levelPack;
|
||||
|
||||
private TopBar topBar;
|
||||
private TextView title;
|
||||
private LevelButton restart;
|
||||
private LevelButton nextLevel;
|
||||
|
||||
public GoalScreen(GameActivity gameActivity) {
|
||||
super(ScreenType.GOAL, gameActivity, R.layout.goal_screen);
|
||||
topBar = super.createTopBar(R.id.goal_screen_topbar);
|
||||
title = (TextView) layout.findViewById(R.id.goal_screen_title);
|
||||
title.setTypeface(gameActivity.getTypeface());
|
||||
restart = new LevelButton(gameActivity, this, layout.findViewById(R.id.goal_screen_restart));
|
||||
nextLevel = new LevelButton(gameActivity, this, layout.findViewById(R.id.goal_screen_next_level));
|
||||
}
|
||||
|
||||
public void onLevelFinished(LevelPack levelPack, Level level){
|
||||
this.levelPack = levelPack;
|
||||
restart.init(level);
|
||||
nextLevel.init(levelPack.getNextLevel(level));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareToBeShown() {
|
||||
topBar.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackKeyDown() {
|
||||
flipTo(ScreenType.LEVELS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(LevelButton levelButton) {
|
||||
gameActivity.startGame(levelPack, levelButton.getLevel());
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package de.frajul.endlessroll.views;
|
||||
|
||||
/**
|
||||
* Created by Julian on 04.11.2017.
|
||||
*/
|
||||
|
||||
public interface LevelButtonOnClickListener {
|
||||
|
||||
public void onClick(LevelButton levelButton);
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package de.frajul.endlessroll.views;
|
||||
|
||||
/**
|
||||
* Created by Julian on 04.11.2017.
|
||||
*/
|
||||
|
||||
public interface WorldButtonOnClickListener {
|
||||
|
||||
public void onClick(WorldButton worldButton);
|
||||
|
||||
}
|
Reference in New Issue
Block a user