diff --git a/Meteo_Engine.jar b/Meteo_Engine.jar index b496c05..e4c7433 100644 Binary files a/Meteo_Engine.jar and b/Meteo_Engine.jar differ diff --git a/src/sig/BlockClump.java b/src/sig/BlockClump.java index 84a6109..862a1f0 100644 --- a/src/sig/BlockClump.java +++ b/src/sig/BlockClump.java @@ -10,8 +10,10 @@ public class BlockClump { double x,y; //the lower-left origin of this block clump. Every block positions relative to this. double yspd; int[][] collisionColumnRanges; - boolean launched=false; //Blocks do not fall when landing (by gravity). - boolean re_sort=false; //Set to true when block clumps are divided into smaller columns for re-sorting. + int launched = -1; /* + Negative is for when block clumps are divided into smaller columns for re-sorting. + Positive is used for how much landing launch time before being split and falling.*/ + public BlockClump(List blockList, double x, double y, double startspd, int width) { this.blocks = new ArrayList(); this.blocks.addAll(blockList); @@ -25,7 +27,6 @@ public class BlockClump { this.x=x; this.y=y; this.yspd=startspd; - System.out.println(Arrays.deepToString(collisionColumnRanges)); } public void updateBlockCollision() { //Call this whenever the block structure changes. This will define what the top and bottom positions diff --git a/src/sig/BlockClumpState.java b/src/sig/BlockClumpState.java new file mode 100644 index 0000000..c260642 --- /dev/null +++ b/src/sig/BlockClumpState.java @@ -0,0 +1,5 @@ +package sig; + +public enum BlockClumpState { + +} diff --git a/src/sig/Board.java b/src/sig/Board.java index fd3abd0..5544a28 100644 --- a/src/sig/Board.java +++ b/src/sig/Board.java @@ -58,47 +58,45 @@ public class Board { if (frames%100==0) { blockData.add(new BlockClump(Arrays.asList(new Block((int)(Math.random()*width),0)),0,590,0,width)); } - + + outerloop: for (BlockClump blocks : blockData) { double FUTURE_FALL_POSITION = blocks.y+blocks.yspd+gravity; - boolean landed=false; - outerloop: for (int x=0;xblocks2.y+(blocks2.collisionColumnRanges[x][0]+1)*block_height) { - blocks.yspd=0; - blocks.y=blocks2.y+(blocks2.collisionColumnRanges[x][0]+1)*block_height; - landed=true; - break outerloop; + HandleBlockLand(blocks, x, blocks2.y+(blocks2.collisionColumnRanges[x][0]+1)*block_height); + continue outerloop; } } else { if (FUTURE_FALL_POSITION+blocks.collisionColumnRanges[x][0]*block_height0) { - blocks.yspd=Math.max(blocks.yspd+gravity,max_fall_spd); - blocks.y+=blocks.yspd; - } else { - //We have hit the bottom. - blocks.yspd=0; - blocks.y=0; - } - } + if (FUTURE_FALL_POSITION>0) { + blocks.yspd=Math.max(blocks.yspd+gravity,max_fall_spd); + blocks.y+=blocks.yspd; + } else { + //We have hit the bottom. + blocks.yspd=0; + blocks.y=0; + } //System.out.println(blocks.y); } } + private void HandleBlockLand(BlockClump blocks, int x, double yset) { + blocks.yspd=0; + blocks.y=yset; + + } public void drawBoard(Graphics g) { final int DRAW_STARTX = (int)(x - block_width*((double)width/2)); final int DRAW_STARTY = (int)(y + block_height*((double)height/2)); diff --git a/src/sig/Meteo.java b/src/sig/Meteo.java index b0403ba..3d7946b 100644 --- a/src/sig/Meteo.java +++ b/src/sig/Meteo.java @@ -18,7 +18,7 @@ public class Meteo { b.run(FRAMECOUNT); } - public static void main(String[] args) { + public static void main(String[] args) { double[] val = {0,0,}; b = new Board(SCREEN_WIDTH/2,SCREEN_HEIGHT/2,24,24,8,14,-0.065,1,4,-2,val);