setup framework for physics engine.
This commit is contained in:
parent
a3b9284e13
commit
808a3c58bb
BIN
Meteo_Engine.jar
BIN
Meteo_Engine.jar
Binary file not shown.
8
run
8
run
@ -1,3 +1,5 @@
|
||||
javac src/sig/*.java -d bin
|
||||
java -cp bin sig/Meteo
|
||||
jar cfe Meteo_Engine.jar sig.Meteo src/sig
|
||||
javac --release 8 src/sig/*.java -d bin
|
||||
cd bin
|
||||
jar cfe ../Meteo_Engine.jar sig.Meteo sig
|
||||
cd ..
|
||||
java -cp bin sig/Meteo
|
@ -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…
x
Reference in New Issue
Block a user