From eda70a8a164f00e290213871c0904a2d3abaf9fb Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 6 Jul 2018 13:13:01 -0500 Subject: [PATCH] Implemented Block Launch Groups. Added Group Merging. --- meteos_war-core/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 18 +- meteos_war-core/assets/fonts/main.fnt | 102 +++++++++++ meteos_war-core/assets/fonts/main.png | Bin 0 -> 5710 bytes meteos_war-core/src/sig/meteos/Block.java | 4 +- .../src/sig/meteos/BlockGroup.java | 21 +++ meteos_war-core/src/sig/meteos/MeteosWar.java | 25 ++- .../src/sig/meteos/MouseProcessor.java | 65 +++++++ meteos_war-core/src/sig/meteos/Planet.java | 162 ++++++++++++++++-- 9 files changed, 367 insertions(+), 32 deletions(-) create mode 100644 meteos_war-core/assets/fonts/main.fnt create mode 100644 meteos_war-core/assets/fonts/main.png create mode 100644 meteos_war-core/src/sig/meteos/MouseProcessor.java diff --git a/meteos_war-core/.classpath b/meteos_war-core/.classpath index ecbc99d..40200f6 100644 --- a/meteos_war-core/.classpath +++ b/meteos_war-core/.classpath @@ -2,7 +2,7 @@ - + diff --git a/meteos_war-core/.settings/org.eclipse.jdt.core.prefs b/meteos_war-core/.settings/org.eclipse.jdt.core.prefs index 0537547..bb35fa0 100644 --- a/meteos_war-core/.settings/org.eclipse.jdt.core.prefs +++ b/meteos_war-core/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,11 @@ -# -#Thu Jul 05 09:24:08 CDT 2018 -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.debug.lineNumber=generate eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/meteos_war-core/assets/fonts/main.fnt b/meteos_war-core/assets/fonts/main.fnt new file mode 100644 index 0000000..529d07d --- /dev/null +++ b/meteos_war-core/assets/fonts/main.fnt @@ -0,0 +1,102 @@ +info face="07LightNovelPOP" size=12 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 +common lineHeight=13 base=11 scaleW=512 scaleH=512 pages=1 packed=0 +page id=0 file="main.png" +chars count=97 +char id=10 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=9 xadvance=6 page=0 chnl=0 +char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=9 xadvance=6 page=0 chnl=0 +char id=33 x=496 y=0 width=4 height=10 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 +char id=34 x=218 y=15 width=8 height=5 xoffset=-1 yoffset=1 xadvance=6 page=0 chnl=0 +char id=35 x=35 y=15 width=10 height=10 xoffset=0 yoffset=1 xadvance=10 page=0 chnl=0 +char id=36 x=76 y=0 width=8 height=12 xoffset=0 yoffset=0 xadvance=8 page=0 chnl=0 +char id=37 x=23 y=15 width=12 height=10 xoffset=0 yoffset=1 xadvance=12 page=0 chnl=0 +char id=38 x=45 y=15 width=12 height=10 xoffset=0 yoffset=1 xadvance=10 page=0 chnl=0 +char id=39 x=232 y=15 width=6 height=5 xoffset=-1 yoffset=1 xadvance=4 page=0 chnl=0 +char id=40 x=34 y=0 width=7 height=13 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=0 +char id=41 x=41 y=0 width=7 height=13 xoffset=-1 yoffset=0 xadvance=6 page=0 chnl=0 +char id=42 x=199 y=15 width=8 height=7 xoffset=-1 yoffset=1 xadvance=6 page=0 chnl=0 +char id=43 x=61 y=15 width=9 height=9 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 +char id=44 x=242 y=15 width=6 height=5 xoffset=-1 yoffset=7 xadvance=4 page=0 chnl=0 +char id=45 x=248 y=15 width=6 height=5 xoffset=0 yoffset=4 xadvance=6 page=0 chnl=0 +char id=46 x=238 y=15 width=4 height=5 xoffset=0 yoffset=6 xadvance=4 page=0 chnl=0 +char id=47 x=84 y=0 width=9 height=11 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 +char id=48 x=487 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=49 x=412 y=0 width=7 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=50 x=419 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=51 x=427 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=52 x=435 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=53 x=444 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=54 x=452 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=55 x=461 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=56 x=469 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=57 x=478 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=58 x=57 y=15 width=4 height=9 xoffset=1 yoffset=2 xadvance=5 page=0 chnl=0 +char id=59 x=0 y=15 width=5 height=10 xoffset=0 yoffset=2 xadvance=5 page=0 chnl=0 +char id=60 x=5 y=15 width=9 height=10 xoffset=0 yoffset=2 xadvance=9 page=0 chnl=0 +char id=61 x=180 y=15 width=9 height=8 xoffset=0 yoffset=3 xadvance=9 page=0 chnl=0 +char id=62 x=14 y=15 width=9 height=10 xoffset=0 yoffset=2 xadvance=8 page=0 chnl=0 +char id=63 x=500 y=0 width=9 height=10 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=64 x=65 y=0 width=11 height=12 xoffset=0 yoffset=1 xadvance=11 page=0 chnl=0 +char id=65 x=102 y=0 width=11 height=10 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=66 x=113 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=67 x=121 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=68 x=130 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=69 x=139 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=0 +char id=70 x=147 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=0 +char id=71 x=155 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=72 x=164 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=73 x=173 y=0 width=4 height=10 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 +char id=74 x=177 y=0 width=8 height=10 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 +char id=75 x=185 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=76 x=194 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=77 x=202 y=0 width=10 height=10 xoffset=0 yoffset=1 xadvance=10 page=0 chnl=0 +char id=78 x=212 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=79 x=221 y=0 width=10 height=10 xoffset=0 yoffset=1 xadvance=10 page=0 chnl=0 +char id=80 x=231 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=81 x=48 y=0 width=11 height=12 xoffset=0 yoffset=1 xadvance=10 page=0 chnl=0 +char id=82 x=240 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=83 x=249 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=84 x=257 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=85 x=266 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=9 page=0 chnl=0 +char id=86 x=275 y=0 width=11 height=10 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=87 x=286 y=0 width=13 height=10 xoffset=-1 yoffset=1 xadvance=11 page=0 chnl=0 +char id=88 x=299 y=0 width=10 height=10 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=89 x=309 y=0 width=10 height=10 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=90 x=319 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=91 x=0 y=0 width=7 height=15 xoffset=0 yoffset=-1 xadvance=6 page=0 chnl=0 +char id=92 x=93 y=0 width=9 height=11 xoffset=-1 yoffset=1 xadvance=7 page=0 chnl=0 +char id=93 x=7 y=0 width=7 height=15 xoffset=-1 yoffset=-1 xadvance=6 page=0 chnl=0 +char id=94 x=189 y=15 width=10 height=7 xoffset=-1 yoffset=1 xadvance=8 page=0 chnl=0 +char id=95 x=254 y=15 width=9 height=5 xoffset=-1 yoffset=9 xadvance=7 page=0 chnl=0 +char id=96 x=226 y=15 width=6 height=5 xoffset=-1 yoffset=0 xadvance=4 page=0 chnl=0 +char id=97 x=70 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=98 x=327 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=99 x=78 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 +char id=100 x=335 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=101 x=86 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 +char id=102 x=343 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=0 +char id=103 x=351 y=0 width=8 height=10 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=104 x=359 y=0 width=8 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=105 x=367 y=0 width=4 height=10 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 +char id=106 x=59 y=0 width=6 height=12 xoffset=-1 yoffset=1 xadvance=5 page=0 chnl=0 +char id=107 x=371 y=0 width=9 height=10 xoffset=0 yoffset=1 xadvance=8 page=0 chnl=0 +char id=108 x=173 y=0 width=4 height=10 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=0 +char id=109 x=94 y=15 width=11 height=8 xoffset=0 yoffset=3 xadvance=10 page=0 chnl=0 +char id=110 x=105 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=111 x=113 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=112 x=380 y=0 width=8 height=10 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=113 x=388 y=0 width=8 height=10 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=114 x=121 y=15 width=7 height=8 xoffset=0 yoffset=3 xadvance=6 page=0 chnl=0 +char id=115 x=128 y=15 width=7 height=8 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 +char id=116 x=396 y=0 width=7 height=10 xoffset=0 yoffset=1 xadvance=7 page=0 chnl=0 +char id=117 x=135 y=15 width=8 height=8 xoffset=0 yoffset=3 xadvance=8 page=0 chnl=0 +char id=118 x=143 y=15 width=9 height=8 xoffset=-1 yoffset=3 xadvance=7 page=0 chnl=0 +char id=119 x=152 y=15 width=12 height=8 xoffset=-1 yoffset=3 xadvance=10 page=0 chnl=0 +char id=120 x=164 y=15 width=9 height=8 xoffset=-1 yoffset=3 xadvance=7 page=0 chnl=0 +char id=121 x=403 y=0 width=9 height=10 xoffset=-1 yoffset=3 xadvance=7 page=0 chnl=0 +char id=122 x=173 y=15 width=7 height=8 xoffset=0 yoffset=3 xadvance=7 page=0 chnl=0 +char id=123 x=14 y=0 width=8 height=15 xoffset=-1 yoffset=-1 xadvance=7 page=0 chnl=0 +char id=124 x=30 y=0 width=4 height=14 xoffset=1 yoffset=-1 xadvance=5 page=0 chnl=0 +char id=125 x=22 y=0 width=8 height=15 xoffset=0 yoffset=-1 xadvance=7 page=0 chnl=0 +char id=126 x=207 y=15 width=11 height=6 xoffset=-1 yoffset=4 xadvance=9 page=0 chnl=0 +char id=127 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=0 +kernings count=0 diff --git a/meteos_war-core/assets/fonts/main.png b/meteos_war-core/assets/fonts/main.png new file mode 100644 index 0000000000000000000000000000000000000000..c0940faa78ddff1dbd13a847013cc02a6dac78df GIT binary patch literal 5710 zcmeI0_fykp*T%ny%8IxaK(GLom7)X|>4YK{iU^^D32kL53DTt|6mea61cE384FbAI z2ay_j5P>M6NJ0+~FeWiTKmsH{67u@I^Zpa>%${G)nYm}q%zd46e`fCMKlXN(M6 z0swHt+Ulkw0POo&?gM@~_%m(Bj_m@#Nm=Wg=FYJ*?71W53gZR94`W4h#S_2n&p!9} zkEh2@q@-OiSG)f7ADNOy=i735U;n9YQO(61k(E8H5zNBK-e*Znfl5H2i4=@WMc)&Q zYvsxOW1|zh(^C`9!M=l&$hFmiA7t(1rv9}vEhk`KcKVqTOh(Uz@9j&BW>KoaOU7;Ce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wRoY&X%Kr5Gg13^DKpYfBn&wR30;bP zXg6spKMU#RUjzc%eN0_D8%t_;BK^YzX)Y(F>IqzAe1NK!=O2;JgX*Iq>>-_0*VZmCeqfcvTiJm7T6fs?B9U`{! zS@VzEw5LU`bI|F0sI}J_`S?buYfS@An%ziUK(%Sotgn-+Ya-UY6JCpaL(feuxn`;+ zNfzvW%*xS!=<=9H__`6~sLh|j@Rzg74)^Yj^|l$9D2QqA0-un#X`B3%>yxVc|7?HbRsS$ah*IMuP@sC z<+?}(_Y~-u6i=465%ZGm3Fzyj_l*f!bxY!YAEGGmc9`+dL+{cU^QgM~Z$f4O0Ifv0s!0%_wud(*W zPF{0L?9`MafqON}HF6|;Us5$RvGD0EiG%Z^&Pxh}BQDH#GSr9&>I1!&Wo3HGap}^w z6o4!Nl-!uJL}K-DeXusuTvEqL-QjWRdF3gkg2m{PUr}4_nM|6Vd0cL2oc=bdX;xU_ zA8)s0o-p{+9@-Wu0<#W?ke?&@EwpjjCNi##+NNxjq$@WkSH)Ax^J3MODKeaUN|BZhY_*a4d#|kWTE+vUw21n@$uO9!ePYhV!vb*{2x=+gg E0CWBCVE_OC literal 0 HcmV?d00001 diff --git a/meteos_war-core/src/sig/meteos/Block.java b/meteos_war-core/src/sig/meteos/Block.java index bd512df..bfc39da 100644 --- a/meteos_war-core/src/sig/meteos/Block.java +++ b/meteos_war-core/src/sig/meteos/Block.java @@ -13,12 +13,14 @@ public class Block { Planet planet; boolean onGround = false; boolean ignited=false; + int id=0; public Block(float xpos,float ypos, BlockColor col, Planet planet) { this.xpos = xpos; this.ypos = ypos; this.col = col; this.planet=planet; + this.id=Planet.BLOCK_ID++; } public void draw(SpriteBatch batch) { @@ -33,7 +35,7 @@ public class Block { public static Block BlockExists(List blocklist, float xpos, float ypos, BlockColor col, Block checkblock) { for (Block b : blocklist) { - if (b!=checkblock && b.col == col && + if (b!=checkblock && b.col == col && b.col!=BlockColor.IGNITED && b.xpos == xpos && b.ypos == ypos) { return b; } diff --git a/meteos_war-core/src/sig/meteos/BlockGroup.java b/meteos_war-core/src/sig/meteos/BlockGroup.java index d989a52..2b40ee4 100644 --- a/meteos_war-core/src/sig/meteos/BlockGroup.java +++ b/meteos_war-core/src/sig/meteos/BlockGroup.java @@ -7,5 +7,26 @@ public class BlockGroup { List blocks = new ArrayList(); float yvel; float weight; + boolean landed=false; Planet planet; + int id=0; + + public BlockGroup(float yvel) { + this.yvel=yvel; + this.id=Planet.GROUP_ID++; + } + + public void setYvelocity(float yvel) { + this.yvel = yvel; + } + + public void setWeight(float weight) { + this.weight=weight; + } + + public void addBlocks(Block...bg) { + for (Block b : bg) { + blocks.add(b); + } + } } diff --git a/meteos_war-core/src/sig/meteos/MeteosWar.java b/meteos_war-core/src/sig/meteos/MeteosWar.java index b4ea58e..30b386d 100644 --- a/meteos_war-core/src/sig/meteos/MeteosWar.java +++ b/meteos_war-core/src/sig/meteos/MeteosWar.java @@ -7,9 +7,11 @@ import java.util.Random; import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Camera; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.Viewport; @@ -25,14 +27,19 @@ public class MeteosWar extends ApplicationAdapter { Camera cam; Calendar lastCheck = Calendar.getInstance(); int framesPassed=0; - public static Random RANDOM = new Random(); + public static Random RANDOM = new Random(59); + boolean singlePass=false; + boolean singleFlag=false; + static int targetFPS = 60; @Override public void create () { batch = new SpriteBatch(); + Planet.debugfont.setColor(Color.RED); LoadImages(); cam = new PerspectiveCamera(); view = new FitViewport(SCREEN_WIDTH,SCREEN_HEIGHT,cam); + Gdx.input.setInputProcessor(new MouseProcessor()); } public void resize(int width, int height) { @@ -42,9 +49,22 @@ public class MeteosWar extends ApplicationAdapter { private void LoadImages() { onebyone = new Texture("1x1.png"); } + + public static void scrollUp() { + System.out.println("Target FPS is now: "+(++targetFPS)); + } + + public static void scrollDown() { + System.out.println("Target FPS is now: "+(--targetFPS)); + } @Override public void render () { + try { + Thread.sleep(1000/targetFPS); + } catch (InterruptedException e) { + e.printStackTrace(); + } run(); Gdx.gl.glClearColor(0, 0, 0.3f, 1); @@ -56,8 +76,9 @@ public class MeteosWar extends ApplicationAdapter { } private void run() { - if (framesPassed%120==0) { + if (framesPassed%60==0 && (!singlePass || (singlePass && !singleFlag))) { Planet.GEOLYTE.SpawnRandomBlock(); + singleFlag=true; } Planet.GEOLYTE.run(); } diff --git a/meteos_war-core/src/sig/meteos/MouseProcessor.java b/meteos_war-core/src/sig/meteos/MouseProcessor.java new file mode 100644 index 0000000..762426a --- /dev/null +++ b/meteos_war-core/src/sig/meteos/MouseProcessor.java @@ -0,0 +1,65 @@ +package sig.meteos; + +import com.badlogic.gdx.InputProcessor; + +public class MouseProcessor implements InputProcessor{ + + @Override + public boolean keyDown(int keycode) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean keyUp(int keycode) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean keyTyped(char character) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean touchDown(int screenX, int screenY, int pointer, int button) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean touchUp(int screenX, int screenY, int pointer, int button) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean touchDragged(int screenX, int screenY, int pointer) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean mouseMoved(int screenX, int screenY) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean scrolled(int amount) { + switch (amount) { + case -1:{ + MeteosWar.scrollUp(); + }break; + case 1:{ + MeteosWar.scrollDown(); + }break; + default:{ + MeteosWar.scrollUp(); + } + } + return true; + } + +} diff --git a/meteos_war-core/src/sig/meteos/Planet.java b/meteos_war-core/src/sig/meteos/Planet.java index 5492dfd..97e2786 100644 --- a/meteos_war-core/src/sig/meteos/Planet.java +++ b/meteos_war-core/src/sig/meteos/Planet.java @@ -4,9 +4,14 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public enum Planet { @@ -24,11 +29,11 @@ public enum Planet { new Texture("block_unknown.png"), new Texture("block1-11.png"), }, - 0.04f, - 0.5f, + -0.04f, + 2.0f, 0.5f, 9, - 1.5f + -1.5f ), ; @@ -41,6 +46,10 @@ public enum Planet { int field_width; List blocklist = new ArrayList(); List grouplist = new ArrayList(); + ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + public static int BLOCK_ID=0; + public static int GROUP_ID=0; + public static BitmapFont debugfont = new BitmapFont(Gdx.files.internal("fonts/main.fnt")); Planet(int id, Texture[] textures, float gravity, float launch_power, float launch_power_mult, int field_width, float max_fall_spd) { this.id = id; @@ -55,40 +64,131 @@ public enum Planet { public void run() { for (Block b : blocklist) { if (!b.isOnGround()) { - b.yspd = Math.min(max_fall_spd, b.yspd + gravity); + if (b.group==null) { + b.yspd = Math.max(max_fall_spd, b.yspd + gravity); + } Block collide = null; if ((collide=ObstructedByBlock(b))!=null) { - b.ypos = collide.ypos + MeteosWar.BLOCK_SIZE; - BlockLanded(b); + if (b.group!=null && b.group.id==2) { + System.out.println("Collision from block "+b.id+" in group 2."); + } + if (b.ypos>collide.ypos && (b.group==null || b.group!=collide.group)) { + if (b.group!=null && b.group.id==2) { + System.out.println("Collision in group "+b.group.id); + } + b.ypos = collide.ypos + MeteosWar.BLOCK_SIZE; + b.yspd = collide.yspd; + BlockLanded(b,collide); + } } else - if (b.ypos-b.yspd < 32+MeteosWar.BLOCK_SIZE) { //Has it reached the bottom of the playing field? + if (b.ypos+b.yspd < 32+MeteosWar.BLOCK_SIZE) { //Has it reached the bottom of the playing field? b.ypos = 32+MeteosWar.BLOCK_SIZE; + if (b.group!=null) { + b.group.yvel=0; + b.group.landed=true; + } BlockLanded(b); } else { - b.ypos -= b.yspd; + if (b.group==null) { + b.ypos += b.yspd; + } } } } + scheduler.schedule(()->{ + for (Block b: blocklist) { + if (b.isOnGround() || b.group!=null) { + List matched_blocks = new ArrayList(); + //System.out.println(blocklist); + if (MatchFound(b,matched_blocks)) { + matched_blocks.add(b); + IgniteBlocks(matched_blocks); + } + } + } + }, 100, TimeUnit.MILLISECONDS); + for (BlockGroup bg : grouplist) { + if (!bg.landed) { + bg.yvel = Math.max(max_fall_spd, bg.yvel + gravity); + for (Block b : bg.blocks) { + b.yspd = bg.yvel; + b.ypos += b.yspd; + //System.out.println("Moving Block "+b); + } + } else { + bg.yvel=0; + //System.out.println("Block group has landed!"); + } + } } private void BlockLanded(Block b) { - b.onGround = true; + BlockLanded(b,null); + } + + private void BlockLanded(Block b, Block collide) { + if (b.group==null || (b.group.landed)) { + b.onGround = true; + System.out.println("Block "+b+" is on the ground."); + } b.yspd = 0; - + if (collide!=null) { + if (collide.group!=null) { + b.onGround = false; + b.yspd = collide.group.yvel; + if (b.group==null) { + b.group = collide.group; + b.group.addBlocks(b); + } else { + MergeGroup(b.group,collide.group); + } + } + } + } - List matched_blocks = new ArrayList(); - //System.out.println(blocklist); - if (MatchFound(b,matched_blocks)) { - matched_blocks.add(b); - IgniteBlocks(matched_blocks); + private void MergeGroup(BlockGroup group1, BlockGroup group2) { + for (int i=0;i matched_blocks) { + BlockGroup bg = new BlockGroup(launch_power); for (Block b : matched_blocks) { - b.ignited=true; + b.ignited = true; b.col = BlockColor.IGNITED; + AddToBlockGroup(b,bg); + b.onGround = false; + b.yspd = bg.yvel; + b.group = bg; + for (Block bb : blocklist) { + if (!matched_blocks.contains(bb) && + bb.isOnGround() && bb.xpos==b.xpos && + bb.ypos>b.ypos) { + System.out.println("Block "+bb+" has been additionally found."); + AddToBlockGroup(bb,bg); + bb.onGround = false; + bb.yspd = bg.yvel; + bb.group = bg; + } + } } + grouplist.add(bg); + } + + private void AddToBlockGroup(Block b, BlockGroup bg) { + bg.addBlocks(b); + b.group = bg; + System.out.println("Block "+b+" added to Block Group "+bg.id+"."); } private boolean MatchFound(Block checkblock,List detectedblocks) { @@ -131,8 +231,10 @@ public enum Planet { //TODO Improve speed by dividing block checks into columns. for (Block b : blocklist) { if (b!=checkblock) { - if (b.xpos == checkblock.xpos && b.ypos+MeteosWar.BLOCK_SIZE > checkblock.ypos - && b.isOnGround()) { + if (b.xpos == checkblock.xpos && + b.ypos+MeteosWar.BLOCK_SIZE > checkblock.ypos && + b.ypos < checkblock.ypos+MeteosWar.BLOCK_SIZE + /*&& b.isOnGround()*/) { //Yes, there is a collision. return b; } @@ -158,6 +260,7 @@ public enum Planet { batch.setColor(Color.WHITE); for (Block b : blocklist) { b.draw(batch); + debugfont.draw(batch, Integer.toString(b.id), b.xpos, b.ypos+12); } } @@ -182,5 +285,28 @@ public enum Planet { Block b = new Block(baseX,MeteosWar.SCREEN_HEIGHT,BlockColor.GetRandomColor(2),this); AddBlock(b); + + /*for (int i=0;i<2;i++) { + int baseX = MeteosWar.SCREEN_WIDTH/2 - ((field_width/2+1) * MeteosWar.BLOCK_SIZE) + + (0+1)*MeteosWar.BLOCK_SIZE; + Block b = new Block(baseX,MeteosWar.SCREEN_HEIGHT-48+i*48,BlockColor.GetRandomColor(1),this); + AddBlock(b); + baseX = MeteosWar.SCREEN_WIDTH/2 - ((field_width/2+1) * MeteosWar.BLOCK_SIZE) + + (1+1)*MeteosWar.BLOCK_SIZE; + b = new Block(baseX,MeteosWar.SCREEN_HEIGHT-48+i*48,BlockColor.GetRandomColor(1),this); + AddBlock(b); + baseX = MeteosWar.SCREEN_WIDTH/2 - ((field_width/2+1) * MeteosWar.BLOCK_SIZE) + + (2+1)*MeteosWar.BLOCK_SIZE; + b = new Block(baseX,MeteosWar.SCREEN_HEIGHT-48+i*48,BlockColor.GetRandomColor(1),this); + AddBlock(b); + baseX = MeteosWar.SCREEN_WIDTH/2 - ((field_width/2+1) * MeteosWar.BLOCK_SIZE) + + (3+1)*MeteosWar.BLOCK_SIZE; + b = new Block(baseX,MeteosWar.SCREEN_HEIGHT-48+i*48,BlockColor.GetRandomColor(1),this); + AddBlock(b); + }*/ + /*baseX = MeteosWar.SCREEN_WIDTH/2 - ((field_width/2+1) * MeteosWar.BLOCK_SIZE) + + (2+1)*MeteosWar.BLOCK_SIZE; + b = new Block(baseX,MeteosWar.SCREEN_HEIGHT+64-48,BlockColor.GREEN,this); + AddBlock(b);*/ } }