From ad4b9ffb99d7a469163d4b0700474eba3940b2a4 Mon Sep 17 00:00:00 2001 From: heurtet Date: Fri, 14 May 2021 00:04:58 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=20r=C3=A9solution=20de=20certains=20bugs?= =?UTF-8?q?=20(probl=C3=A8me=20la=20musique=20du=20menu=20de=20pause=20pre?= =?UTF-8?q?nd=20la=20place=20de=20celle=20de=20la=20game)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/sagittarius/view/GameScreen.java | 12 +++++++----- core/src/sagittarius/view/ResumeScreen.java | 13 ++++++++----- core/src/sagittarius/view/SettingsScreen.java | 12 ++++++++---- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/core/src/sagittarius/view/GameScreen.java b/core/src/sagittarius/view/GameScreen.java index 2d0c5bc..0cde633 100644 --- a/core/src/sagittarius/view/GameScreen.java +++ b/core/src/sagittarius/view/GameScreen.java @@ -48,11 +48,13 @@ public class GameScreen extends BaseScreen implements InputProcessor { @Override public void initialize() { - if (SagittariusGame.music.isPlaying()){ - SagittariusGame.music.stop(); - SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/HMO-MercuryCity.mp3")); - SagittariusGame.music.setLooping(true); - SagittariusGame.music.play(); + if (!SagittariusGame.disableMusic){ + + SagittariusGame.music.stop(); + SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/HMO-MercuryCity.mp3")); + SagittariusGame.music.setLooping(true); + SagittariusGame.music.play(); + } Gdx.input.setInputProcessor(this); diff --git a/core/src/sagittarius/view/ResumeScreen.java b/core/src/sagittarius/view/ResumeScreen.java index 8cb0606..3f88f68 100644 --- a/core/src/sagittarius/view/ResumeScreen.java +++ b/core/src/sagittarius/view/ResumeScreen.java @@ -24,11 +24,12 @@ public class ResumeScreen extends BaseScreen { @Override public void initialize() { - SagittariusGame.music.stop(); - SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/Metre - Concentric.mp3")); - SagittariusGame.music.setLooping(true); - SagittariusGame.music.play(); - + if (!SagittariusGame.disableMusic){ + SagittariusGame.music.stop(); + SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/Metre - Concentric.mp3")); + SagittariusGame.music.setLooping(true); + SagittariusGame.music.play(); + } Gdx.input.setInputProcessor(uiStage); // Table creation @@ -63,10 +64,12 @@ public class ResumeScreen extends BaseScreen { // Deactivate music or not if (disableMusic.isChecked() && SagittariusGame.music.isPlaying()){ SagittariusGame.music.stop(); + SagittariusGame.disableMusic = true; } else if (!disableMusic.isChecked() && ! SagittariusGame.music.isPlaying()){ SagittariusGame.music.play(); + SagittariusGame.disableMusic = false; } } diff --git a/core/src/sagittarius/view/SettingsScreen.java b/core/src/sagittarius/view/SettingsScreen.java index b373568..1b71414 100644 --- a/core/src/sagittarius/view/SettingsScreen.java +++ b/core/src/sagittarius/view/SettingsScreen.java @@ -18,10 +18,12 @@ public class SettingsScreen extends BaseScreen { @Override public void initialize() { - SagittariusGame.music.stop(); - SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/Metre - Concentric.mp3")); - SagittariusGame.music.setLooping(true); - SagittariusGame.music.play(); + if (!SagittariusGame.disableMusic){ + SagittariusGame.music.stop(); + SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/Metre - Concentric.mp3")); + SagittariusGame.music.setLooping(true); + SagittariusGame.music.play(); + } Gdx.input.setInputProcessor(uiStage); @@ -67,10 +69,12 @@ public class SettingsScreen extends BaseScreen { // Deactivate music or not if (disableMusic.isChecked() && SagittariusGame.music.isPlaying()){ SagittariusGame.music.stop(); + SagittariusGame.disableMusic = true; } else if (!disableMusic.isChecked() && ! SagittariusGame.music.isPlaying()){ SagittariusGame.music.play(); + SagittariusGame.disableMusic = false; } } From 19881f9ae5b29969ce3a2d689e386124c4d73a72 Mon Sep 17 00:00:00 2001 From: Damien Date: Fri, 14 May 2021 10:01:17 +0200 Subject: [PATCH 2/4] passage de l'arrow0 en 32x32 --- core/assets/arrow0.png | Bin 6304 -> 783 bytes core/assets/player1.png | Bin 1367 -> 1523 bytes core/src/sagittarius/model/Arrow.java | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/assets/arrow0.png b/core/assets/arrow0.png index 0e490254f03d49c9689c109615e09312e70efd15..db0a872a282fd149d1223dd99dbad852dbcf106c 100644 GIT binary patch delta 757 zcmViziBL{Q4GJ0x0000DNk~Le0000W0000W2nGNE0CReJ^pPPbf5HF& z4#EKyC`y0;00N{*L_t(oN4=L#h>cMg$Ir!JY8Fys%H(4(q|9ar327`y6C06_g-Ds1 zvY9fHjV)zTRzfMUQfd}bDCJ{?!a@zj!uTlVvl$pi#Nj9k1k*iN{BPq1r$e_QP5QjB^ZoGoCQQ!TIbvOf~f3POdgmaUk zn~KwtqFWfE8EXQEaTh+t?B1Urq8U>HY(>ra4ZMb5)D~D2q8Xn+34ARdx9|jJ=RJBW z7P6feAQY>@ir3t0Cv5f&&b`Ew*vJU!h#r%)pV58ziZzKWVGH)+JrdB=RKTMf2=9~H z2x&j%&Xh!N=W_RR@LOofe@~&N&ehbnxL*SgL(2%u)@*a_2Tz5X=NYyn#mpKw-O;M( z8?BUvhg|88&ZU1T7KcNrOu6$iN+2aPnP3`vuq#w6;E^+vCsz_aj#`Ae7p%rDSc`fy zp2KF=fG#UzlJ+yY4`0!Tc{&#)&_~eSAj@4k-w?_s{2IvHd0;2%f1U8b*AjF;jKXvh zhAr2IJFs4rfX;#_ObLLlWSW9inEmeS5Y1QG!FVEES(-r#v$OONVY+zv4c%Lv@ZW2j5%S^SDW@FqrMIRQP4g#Hg)#ueDd{BKoz nEY>w3bOO%82dIN-0yy^hA2MssbkPnTh+>B2IkT#CqunrrnbLSd#NHYTG& zH4=S7x#W@$m2M0v6s7PzZ+(B?e|~>>IOlcF`@HVwyq>Sc)12&-aLaK303`=|%5DJA zLI6-)tQ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z|0elAFB$Ia%z-cD$o^-FKHFn=HI1rg$_dG9JA+rGfVeAq1QzEe~Qal?Rf;czx`j7k3!f@wD=)jA?!Q*)NF5Mp&#Zg%G`f-=`os0W@S_!5;v z-6L)|EGr))TFr~J#YWV_%1Vf)A8N&f zUoz#F$nd+w5COi%7peUElZfuu)Y~PZIZE{@pZm39sQmA9Tq8pX_SiS!dD{gOU Zc?ZkT*eydK;$i>*002ovPDHLkV1kr-n7;r3 diff --git a/core/src/sagittarius/model/Arrow.java b/core/src/sagittarius/model/Arrow.java index d3f375e..c112e9c 100644 --- a/core/src/sagittarius/model/Arrow.java +++ b/core/src/sagittarius/model/Arrow.java @@ -43,8 +43,8 @@ public class Arrow extends EntityQuad { super(0, 1, shooter.getColor(), shooter.getPosition()); this.velocity = new Vector2(power, 0).setAngleDeg(angle); this.acceleration = new Vector2(); - this.setOrigin(80, 2); - this.setSize(100, 4); + this.setOrigin(40, 2); + this.setSize(50, 4); this.force = computeForce(); this.landed = false; @@ -108,7 +108,7 @@ public class Arrow extends EntityQuad { @Override public void draw(Batch batch, float parentAlpha) { - batch.draw(texture, getPosition().x - 0.8f * getWidth(), getPosition().y - getHeight()/2 - 10, 0.8f * this.getWidth(), this.getHeight()/2 + 10, getWidth(), 20 + getHeight(), + batch.draw(texture, getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(), 1, 1, getRotation(), 0, 0, texture.getWidth(), texture.getHeight(), false, false); super.draw(batch, parentAlpha); } From 58eb1f71362ee1613a9f6795831b20c09939d794 Mon Sep 17 00:00:00 2001 From: Damien Date: Fri, 14 May 2021 10:33:03 +0200 Subject: [PATCH 3/4] ajout des textures d'annimation --- core/assets/{arrow0.png => arrow0-0.png} | Bin core/assets/arrow0-1.png | Bin 0 -> 792 bytes core/assets/arrow0-2.png | Bin 0 -> 786 bytes core/assets/arrow0-3.png | Bin 0 -> 777 bytes core/assets/{arrow1.png => arrow1-0.png} | Bin core/assets/{arrow2.png => arrow2-0.png} | Bin core/src/sagittarius/model/Arrow.java | 50 +++++++++++++++-------- 7 files changed, 32 insertions(+), 18 deletions(-) rename core/assets/{arrow0.png => arrow0-0.png} (100%) create mode 100644 core/assets/arrow0-1.png create mode 100644 core/assets/arrow0-2.png create mode 100644 core/assets/arrow0-3.png rename core/assets/{arrow1.png => arrow1-0.png} (100%) rename core/assets/{arrow2.png => arrow2-0.png} (100%) diff --git a/core/assets/arrow0.png b/core/assets/arrow0-0.png similarity index 100% rename from core/assets/arrow0.png rename to core/assets/arrow0-0.png diff --git a/core/assets/arrow0-1.png b/core/assets/arrow0-1.png new file mode 100644 index 0000000000000000000000000000000000000000..c3efdde6799aecc72e1e4b9f46b736e9f5978445 GIT binary patch literal 792 zcmV+z1LypSP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940|@HTwGQP|pMGnvY4-1T)@ARt3(k`(_lLR&m+=Mm9oR7A zmHO*tl0_fh;b+`}$JFsRm~aI6d9aXEg&{rC|VGYVy5U3g6aMeHD4!)ZxJl~ok+ z#M)7KuK__J3kltL5Zh5xc!DC%5TghxKv2X+!e(5AD{&d#q=+73Fu?@~invPHgZcj- zpokUL_9kQ(FD6?If+Q+@CTaoB$80V1P~1Ihdl5SVn)BOu1HY)xSZdLmq<}IcS7F@6)0m(4 z4vXFt^2rNe%|F5vXx_C8wk93Uy~K0a!szI6J&r8T?>Ul-m?AQ4>lN`K$u%W4aO(wx z_vuxYEKenwiYOlGbR$Dwt;e52L!)b$*XBkCA6rkA*45pvtM|NJB@AF&+RUwii-$WD zlg?1eW5cfeQ_rLEluBdPs!&N@K?P)3R}f4?5qH^T4cxLhy>l)0=l^IC`X{|l5o-wj*o@j0-$|}FWDv0OQYAnBemO$#p25i*HZ|kvXVC>3U)?K_ftN{bC(Lv<3H~K2}bWJnBR&yw(7T|JjGh zgi}CreVXmW5BLaMt=&ZOx5T>e-USq*FCmSBrr;9E52?RiLe@YF>iBgB&#I$-ocjfq WdGV0*l~=C-0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940;fqtK~z{r&6iDx zO<@?v-;424SH>VQND`YFWo8y43tyq82!)*#Wu|N_SSVSd+!8ioiKfU-3M-L>GFwFX zTqq(lhPl`8f9`YcJ=aIQ&$$+U_3Jt3ojK=u&iirCdkP_v3%7@Q3Fq-K_U~Rj>6zM_ zWsJobUgJkxj|bK8FNo>^o_-wR5H7|qxC=kvTzaBH%#CLVHWM!6gruR)GK#ow$8MsB zfF#!l3$PC#Vj0C6i@AvIffRZ|3D@Bq?7>BNl>)aB-M9-76mgNT1GCo;Qp6HFj>fYJ z5=gFa2H)Z^YA7@@-N}W!062i^f!V0*zhe2?X{_0r+J#@b&rW z1heaZzC|~#0(eS|_jSC2pVVe7wCE-&paRKR95?YOX2-nCqMJfCc>(P3uP_hB6ISAe zq#=Z-cpTg5A+3f#lIHm}M{?pVB8x4{65gQz4NU{wdM4pr^{h^srKI}7+Pj@hLJb-tffxJ@=c+4&j~wA7{t!%VP+1T+}EX;G613H9pD_Sy@JZaiI|KriTZte4U}96?Pk z?GvXm53<7&g}VSj5i1A-*oImaUr9ch=*Bw)DcTdv!ilJR6e&utXg6amMnfWPN~hyX zRM$^KZAw=W-FR1lwqe=@Ybk1Dq7RkBB+s=Y7SRQeTpuRS@ho;@dhIQXxriD9lIzoK z3%LP_-YlLu(2m-M-N0jNXr2&$0&{Zf>LHnl QV*mgE07*qoM6N<$g4~K;;Q#;t literal 0 HcmV?d00001 diff --git a/core/assets/arrow0-3.png b/core/assets/arrow0-3.png new file mode 100644 index 0000000000000000000000000000000000000000..726a4646476ed2cccf563be901df8a83a7103840 GIT binary patch literal 777 zcmV+k1NQuhP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940-i}kK~z{r&6iDx zO<@?v-;3*`lu2pIS0)pi8D&OH%Em`gQ)HB|5m6{*qltwqY$&%ZiJgxWE5!mE--KdC zBa$W-im3T8bFbh3oaf$qu8-zC=UDjFujf7Q+ zQ@~bSf&Dm$YC#JtL&%Qj7%Ft(2u`+G#0o_;5i{Z4gt`aJjfY_(R!_rxi*CFH?8hzm z0+VNdo<%pV0%(K!ejTsiSIrr%7TrVzR3N%a$4xwn$-Z}3bW=zsFMtjI3L8$n*J;rA zg6PBJIExk1E&7jC^Zc44y6_f}#ExMJ?^1wT(*PgcO!ydI)v4yGB~uZly`5ob;G4~) zr%;?4iZj~7aQ_3FsnfQ6edykG!mc7-VtYJH?17VeIuxTxFO|{3P#Mv^>37QIQ5)5$ zC9k0Zs@RkZ+EBtCyKI1uoF0F2BlhS2XcMMME-2s$LEnZ+E|Yw-ja@{0AZ>DEH6Fn) z(N)Ydi*8(ZLjHTbejTdc(==zO4ViEi0H^RGF2dxhy|d`XTfkd<9}mMY4#mTe`6s%! zfQP7G$2#H=8i zTLf*wd#D?Z3g}^F4iPis-2+Qe-+Y}|eeW@fSY~54<1LN}Nwn!U;wQY1Z8mOVbv_U? z;kg5 texture; // ---------- CONSTRUCTORs ---------- @@ -49,24 +51,35 @@ public class Arrow extends EntityQuad { this.landed = false; if (!preview) { - Pixmap pm = new Pixmap(new FileHandle("core/assets/arrow" + MathUtils.random(2) + ".png")); - pm.setBlending(Pixmap.Blending.None); - for (int x = 0; x < pm.getWidth(); x++) { - for (int y = 0; y < pm.getHeight(); y++) { - - Color pc = new Color(); - Color.rgba8888ToColor(pc, pm.getPixel(x, y)); - - if (pc.r == 1 && pc.g == 1 && pc.b == 1) { - pc.r = getColor().r; - pc.g = getColor().g; - pc.b = getColor().b; + texture = new ArrayList<>(); + String path = "core/assets/arrow" + MathUtils.random(0); + + int i = 0; + while (true) { + try { + Pixmap pm = new Pixmap(new FileHandle(path + "-" + i + ".png")); + pm.setBlending(Pixmap.Blending.None); + for (int x = 0; x < pm.getWidth(); x++) { + for (int y = 0; y < pm.getHeight(); y++) { + + Color pc = new Color(); + Color.rgba8888ToColor(pc, pm.getPixel(x, y)); + + if (pc.r == 1 && pc.g == 1 && pc.b == 1) { + pc.r = getColor().r; + pc.g = getColor().g; + pc.b = getColor().b; + } + + pm.drawPixel(x, y, Color.rgba8888(pc)); + } } - - pm.drawPixel(x, y, Color.rgba8888(pc)); + texture.add(new Texture(pm)); + i++; + } catch (com.badlogic.gdx.utils.GdxRuntimeException e) { + break; } } - texture = new Texture(pm); } } @@ -108,8 +121,9 @@ public class Arrow extends EntityQuad { @Override public void draw(Batch batch, float parentAlpha) { - batch.draw(texture, getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(), - 1, 1, getRotation(), 0, 0, texture.getWidth(), texture.getHeight(), false, false); + int i = (int) (TTL * 3) % 4; + batch.draw(texture.get(i), getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(), + 1, 1, getRotation(), 0, 0, texture.get(i).getWidth(), texture.get(i).getHeight(), false, false); super.draw(batch, parentAlpha); } From 457dcbf7c2f7e0188fa08ae13aef699bf5b2a282 Mon Sep 17 00:00:00 2001 From: Damien Date: Fri, 14 May 2021 10:37:40 +0200 Subject: [PATCH 4/4] remise des autres fleches --- core/src/sagittarius/model/Arrow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/sagittarius/model/Arrow.java b/core/src/sagittarius/model/Arrow.java index a790b21..73c0f5a 100644 --- a/core/src/sagittarius/model/Arrow.java +++ b/core/src/sagittarius/model/Arrow.java @@ -52,7 +52,7 @@ public class Arrow extends EntityQuad { if (!preview) { texture = new ArrayList<>(); - String path = "core/assets/arrow" + MathUtils.random(0); + String path = "core/assets/arrow" + MathUtils.random(2); int i = 0; while (true) { @@ -121,7 +121,7 @@ public class Arrow extends EntityQuad { @Override public void draw(Batch batch, float parentAlpha) { - int i = (int) (TTL * 3) % 4; + int i = (int) (TTL * 3) % texture.size(); batch.draw(texture.get(i), getPosition().x - getOriginX(), getPosition().y - getWidth()/2, getOriginX(), getWidth()/2, getWidth(), getWidth(), 1, 1, getRotation(), 0, 0, texture.get(i).getWidth(), texture.get(i).getHeight(), false, false); super.draw(batch, parentAlpha);