Skip to content

Commit

Permalink
[fix] Reformats spacing on SpyFish + removes unused members
Browse files Browse the repository at this point in the history
  • Loading branch information
fegemo committed Sep 27, 2017
1 parent 16f828d commit 4fd7b9d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
23 changes: 14 additions & 9 deletions core/src/br/cefetmg/games/minigames/SpyFish.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SpyFish extends MiniGame {
private Texture texturaFundo;
private final Texture texturaMemoCard;
private final Texture textureFishSheet;

private ArrayList<MemoryChip> chip;

private static SpriteBatch batch;
Expand Down Expand Up @@ -65,15 +65,19 @@ protected void onStart() {

@Override
protected void configureDifficultyParameters(float difficulty) {
this.MAX_CHIPS = (int) DifficultyCurve.LINEAR_NEGATIVE.getCurveValueBetween(difficulty, 7, 15);
this.NUM_CHIPS_TO_TAKE = (int) DifficultyCurve.LINEAR.getCurveValueBetween(difficulty, 1, 5);
this.VELOCIDADE_MAX_CHIP = (float) DifficultyCurve.S.getCurveValueBetween(difficulty, 1, 9);
this.MAX_CHIPS = (int) DifficultyCurve.LINEAR_NEGATIVE
.getCurveValueBetween(difficulty, 7, 15);
this.NUM_CHIPS_TO_TAKE = (int) DifficultyCurve.LINEAR
.getCurveValueBetween(difficulty, 1, 5);
this.VELOCIDADE_MAX_CHIP = (float) DifficultyCurve.S
.getCurveValueBetween(difficulty, 1, 9);
}

@Override
public void onHandlePlayingInput() {
// move o peixe
this.fish.updateAccordingToTheMouse(getMousePosInGameWorld().x, getMousePosInGameWorld().y);
this.fish.updateAccordingToTheMouse(
getMousePosInGameWorld().x, getMousePosInGameWorld().y);
}

@Override
Expand All @@ -91,8 +95,8 @@ public void onUpdate(float dt) {
if (mc.getPositionMemoryCard().y < -1) {
NUM_DE_CHIPS_PERDIDO++;
if (NUM_DE_CHIPS_PERDIDO > (this.MAX_CHIPS + this.NUM_CHIPS_TO_TAKE)) {
// se chegar nessa parte do codigo, é pq não tem como mais pegar o numero minimo
//de chips
// se chegar nessa parte do codigo, é pq não tem como
// mais pegar o numero minimo de chips
super.challengeFailed();
break;
}
Expand Down Expand Up @@ -154,6 +158,7 @@ public boolean shouldHideMousePointer() {
}

class Fish extends Sprite implements Collidable {

private Vector2 alvo;
private Pose pose;
private int lado;
Expand Down Expand Up @@ -255,6 +260,7 @@ public Circle getMinimumEnclosingBall() {
}

class MemoryChip implements Collidable {

private float radius;
private final Vector2 position = new Vector2();
private final Circle circle;
Expand Down Expand Up @@ -336,6 +342,7 @@ public Rectangle getMinimumBoundingRectangle() {
}

class Pose {

public Vector2 posicao;
public Vector2 velocidade;
public float orientacao;
Expand Down Expand Up @@ -509,7 +516,6 @@ public static final boolean circlesOverlap(Circle c1, Circle c2) {
* @param r2 retângulo 2
* @return true se há colisão ou false, do contrário.
*/

public static final boolean rectsOverlap(Rectangle r1, Rectangle r2) {
return r1.contains(r2);
}
Expand All @@ -520,7 +526,6 @@ public static final boolean circleRectCollision(Rectangle r2, Circle c1) {
}

// ----------------------------------------------------------------------------------------------------------------------------

interface Collidable {

/**
Expand Down
25 changes: 10 additions & 15 deletions core/src/br/cefetmg/games/minigames/factories/SpyFishFactory.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.cefetmg.games.minigames.factories;

import br.cefetmg.games.minigames.MiniGame;
Expand All @@ -17,25 +12,25 @@
*
* @author Luiza Pedro
*/
public class SpyFishFactory implements MiniGameFactory{
public class SpyFishFactory implements MiniGameFactory {

@Override
public MiniGame createMiniGame(BaseScreen screen, MiniGameStateObserver observer, float difficulty) {
public MiniGame createMiniGame(BaseScreen screen,
MiniGameStateObserver observer, float difficulty) {
return new SpyFish(screen, observer, difficulty);
}

@Override
public Map<String, Class> getAssetsToPreload() {
return new HashMap<String, Class>(){
return new HashMap<String, Class>() {
{
put("spy-fish/fish.png", Texture.class );
put("spy-fish/card.png",Texture.class);
put("spy-fish/ocean.jpeg",Texture.class);
put("spy-fish/fishsheet.png",Texture.class);
put("spy-fish/fish.png", Texture.class);
put("spy-fish/card.png", Texture.class);
put("spy-fish/ocean.jpeg", Texture.class);
put("spy-fish/fishsheet.png", Texture.class);

}
};
//To change body of generated methods, choose Tools | Templates.
}

}

0 comments on commit 4fd7b9d

Please sign in to comment.