setup framework for physics engine.

This commit is contained in:
sigonasr2, Sig, Sigo 2021-09-16 07:24:40 +00:00
parent a3b9284e13
commit 808a3c58bb
5 changed files with 30 additions and 7 deletions

Binary file not shown.

8
run
View File

@ -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

View File

@ -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 + "]";
}
}

View File

@ -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 + "]";
}
}

View File

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