Skip to content

Commit

Permalink
New multiplayer stuff
Browse files Browse the repository at this point in the history
Lots of bugs included
  • Loading branch information
Matrx007 committed Jan 16, 2019
1 parent de0ec5e commit ae1522b
Show file tree
Hide file tree
Showing 16 changed files with 803 additions and 372 deletions.
4 changes: 4 additions & 0 deletions src/com/youngdev/shooter/Branches.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ public void update() {
xx += Main.toSlowMotion(speedX);
yy += Main.toSlowMotion(speedY);

if(speedX != 0 || speedY != 0) {
needsUpdate = true;
}

owner.x = (int)xx;
owner.y = (int)yy;

Expand Down
5 changes: 3 additions & 2 deletions src/com/youngdev/shooter/Bush.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public Bush(int x, int y) {

@Override
public void update(Input input) {
this.prevCollision = collision;
collision = false;

Iterator<GameObject> it;
Expand All @@ -75,6 +76,8 @@ public void update(Input input) {
}
}

if(collision != prevCollision) needsUpdate = true;

boolean collision_EffectivelyFinal = collision;
boolean spawn = random.nextInt(16) == 3;

Expand All @@ -97,8 +100,6 @@ public void update(Input input) {
leave.addX = (int)(Math.cos(Math.toRadians(leave.step))*2d);
leave.addY = (int)(Math.sin(Math.toRadians(leave.step))*2d);
});

this.prevCollision = collision_EffectivelyFinal;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/com/youngdev/shooter/Fly.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public Fly(int x, int y, boolean state) {

@Override
public void update(Input input) {
needsUpdate = true;
if(dead) return;
if(state) {
double minDis = Double.MAX_VALUE;
Expand Down
Loading

0 comments on commit ae1522b

Please sign in to comment.