setup framework for physics engine.

concurrentModificationException1
sigonasr2, Sig, Sigo 3 years ago
parent a3b9284e13
commit 808a3c58bb
  1. BIN
      Meteo_Engine.jar
  2. 6
      run
  3. 17
      src/sig/Block.java
  4. 9
      src/sig/BlockClump.java
  5. 3
      src/sig/Board.java

Binary file not shown.

6
run

@ -1,3 +1,5 @@
javac src/sig/*.java -d bin
javac --release 8 src/sig/*.java -d bin
cd bin
jar cfe ../Meteo_Engine.jar sig.Meteo sig
cd ..
java -cp bin sig/Meteo
jar cfe Meteo_Engine.jar sig.Meteo src/sig

@ -2,8 +2,21 @@ package sig;
public class Block{
BlockState state;
int x,y; //Relative to its block clump.
int x,y; //Relative to its block clump
final static BlockState[] STARTINGSTATES = {BlockState.BLUE,
BlockState.GREEN,
BlockState.ORANGE,
BlockState.PURPLE,
BlockState.RED,
BlockState.WHITE,
BlockState.YELLOW,};
public Block(int x,int y) {
this.x=x;
this.y=y;
state = STARTINGSTATES[(int)(Math.random()*STARTINGSTATES.length)];
}
@Override
public String toString() {
return "Block [state=" + state + ", x=" + x + ", y=" + y + "]";
}
}

@ -6,7 +6,14 @@ public class BlockClump {
List<Block> blocks;
double x,y; //the lower-left origin of this block clump. Every block positions relative to this.
double yspd;
public BlockClump(List<Block> blockList) {
public BlockClump(List<Block> blockList, double x, double y, double startspd) {
this.blocks = blockList;
this.x=x;
this.y=y;
this.yspd=startspd;
}
@Override
public String toString() {
return "BlockClump [blocks=" + blocks + ", x=" + x + ", y=" + y + ", yspd=" + yspd + "]";
}
}

@ -30,6 +30,7 @@ public class Board {
}
}
BlockClump defaultClump = new BlockClump(initialBlocks);
BlockClump defaultClump = new BlockClump(initialBlocks,0,0,0);
System.out.println(defaultClump);
}
}

Loading…
Cancel
Save