Skip to content

Commit

Permalink
but how?
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0602 committed Apr 20, 2019
1 parent 233a18f commit 0a99ecd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/sma/rhythmtapper/game/GameScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ private void paintBall(Graphics g, Ball b)
Ball next = b.nextBall;
if(next != null)
{
aliveTails.add(b.tail);
aliveTails.add(b.connector);
}
g.drawImage(imgToDraw, (int)(b.x - sizeCoeff), (int)(b.y - sizeCoeff),sizeCoeff*2,sizeCoeff*2);
/* switch (b.type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public static List<Ball> Read(File file) throws FileNotFoundException, JSONExcep
Log.v(TAG,"connect "+id+" with"+prevMap.get(id));
Ball ba = id2Ball.get(id); //formar
ba.nextBall = id2Ball.get(prevMap.get(id)); //next
ba.tail = new Connector(ba, ba.nextBall);
if(ba.isSlideNote()||ba.isLongNote())
{
ba.connector= new Tail(ba, ba.nextBall);
} else{
ba.connector = new Connector(ba, ba.nextBall);
}
}
for(Ball b:id2Ball.values())
{
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/sma/rhythmtapper/game/models/Ball.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ private void RemoveSelf()
}
void Erase()
{
if(tail==null)
if(connector==null)
return;
tail.ball2.Erase();
connector.ball2.Erase();
RemoveSelf();
}
public boolean isSlideEnd()
{
return isSlideNote()&& tail==null;
return isSlideNote()&& connector==null;
}
public boolean isSlideDownOrMiddle()
{
return tail!=null && isSlideNote();
return connector!=null && isSlideNote();
}

//FixMe
public boolean isSlideStart()
{
return isSlideNote()&&tail!=null;
return isSlideNote()&&connector!=null;
}

public boolean isLongUp()
{
return isLongNote()&& tail==null;
return isLongNote()&& connector==null;
}
public boolean isNormal()
{
Expand All @@ -67,7 +67,7 @@ public boolean isFlick()
}
public boolean isLongDown()
{
return isLongNote()&& tail!=null;
return isLongNote()&& connector!=null;
}
public boolean isLongNote()
{
Expand Down Expand Up @@ -124,7 +124,7 @@ public BallType valueOf()

public boolean alive;

public Connector tail;
public Connector connector;
public HelperLine helperLine;
/*
public Ball(int x, int y, BallType type){
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/sma/rhythmtapper/game/models/Connector.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Connector implements Serializable {
float difftime;
float diffY;

float[] tailxs;

//Ball1 is first (lower)
public Connector(Ball ball1, Ball ball2) {
this.ball1 = ball1;
Expand All @@ -40,11 +40,11 @@ public void Paint(Graphics g) {
// }

g.drawLine(ghost1x, ghost1y, ghost2x, ghost2y,ball1.color,40);
if(ghost1y > EnvVar.HITBOX_CENTER && ghost2y <EnvVar.HITBOX_CENTER) {
/*if(ghost1y > EnvVar.HITBOX_CENTER && ghost2y <EnvVar.HITBOX_CENTER) {
int helperx = (GameScreen.HITBOX_CENTER - ghost1y) * (ghost2x - ghost1x) / (ghost2y - ghost1y) + ghost1x;
g.drawImage(Assets.ballHitpoint, (int) (helperx - SIZE_BALL), (int) (EnvVar.HITBOX_CENTER - SIZE_BALL)
, SIZE_BALL * 2, SIZE_BALL * 2);
}
}*/
return;
}

Expand Down
18 changes: 10 additions & 8 deletions app/src/main/java/sma/rhythmtapper/game/models/Tail.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ public Tail(Ball ball1,Ball ball2)
{
super(ball1,ball2);
}
float[] tailxs;
@Override
public void Paint(Graphics g) {
// if (ball1.alive && ball2.alive)
// {
//
// }
// else
// {
public void Paint(Graphics g) {
UpdateGhosts();
// }
MakeTails();
int x = ghost2x;
int y = ghost2y;
for(int i=0;i<tailxs.length;i++)
{
//x = tailxs[i];
//y =
}
g.drawLine(ghost1x, ghost1y, ghost2x, ghost2y,ball1.color,40);
if(ghost1y > EnvVar.HITBOX_CENTER && ghost2y <EnvVar.HITBOX_CENTER) {
int helperx = (GameScreen.HITBOX_CENTER - ghost1y) * (ghost2x - ghost1x) / (ghost2y - ghost1y) + ghost1x;
Expand Down

0 comments on commit 0a99ecd

Please sign in to comment.