From d010bd56da0845a09b30ef90e8dcc2047d38478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20C=C3=A9r=C3=A8s?= Date: Wed, 6 Apr 2016 15:35:15 +0200 Subject: [PATCH] mise a jour des textures --- res/ball.png | Bin 212 -> 992 bytes res/block.png | Bin 155 -> 1120 bytes src/block.cpp | 2 +- src/object.cpp | 7 +++++++ src/player.cpp | 11 +++++++++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/res/ball.png b/res/ball.png index 86d0bce5fc9b21aecf8e8e4285076d8869f0e73e..bceb8465681d1e142de4de4ebd22fae593eb35b7 100644 GIT binary patch delta 982 zcmV;{11bE}0pJIa7=H)`0001ui5(39000JJOGiWi{{a60|De66lK=n!32;bRa{vID z$^ZbF$^qk%q#^(S00(qQO+^Rb1O^QbHOiARzyJUPZAnByR5;6plut+_cNE9J^Lz6r znKcGw2eQP?qM-*ZG{Sl+7^M`v7nDV4i6FV|Vd-ga6-uG#o`2d?D231-Dik~jIRG|eL_m&;FXZf^cK zI5?2rS6Lk6@fe(Q1VNCb@B2ulQt0>lpB0P6ALLT0w4*4BbYHU%1!D|E1R{c_X_%dz zMK+ry*L7dB!CVp)JkLwO0FX|n6FDSFf=oo*vMe>$M3!X`QQ~S`o#%OQ90#7~!F62(K>$@% z!59Mo*tQKJ1Y{z*Y`5FRSdUaHg;;{gWP;IXgnuv$lj?@UAsoj65hdq@5O5p^x~_Y) zw6rvRc6Ro~!oor#{M$3;x-J~Yf$O@kZ5y_20{|37NxET-q19?32!iivW@g5;ZTsc) z^t41oiDoe@2E|au*gG)CanNiwqwVeOFR9z@4vNL%)cN`O=Z0Y*48z2PxH{Xm5r!d% z2!E=o-ho9?gj%fzUDtox-{1c;v2=BH^&eGLmzI~8k;!DBY1*B?A)QV`RaGd80!2|k zM2MmYM@L8K_xqhjqw(y{w&`>_Kj-uL7rkEZaVnJpV+@icCGEw@7)#o$)oSp4zhj!_ zCs$WjlLr^<+S=MLZ~%)r2R1cVu1+T102y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00YQLL_t(&-tF1XOCx6(2k`GZ znas=^U1$Tg-L|WXw7ZH(CB_tqum~n#2K`sOisC`glY)W>LGtJRYd3iu3bx`2Bw9y6$lGB+9bfQLR>grj$OJo11eLEs7%Y`8@Xb z_tDeSgW=&}Fvf1LxGc+GmP(}`Y}@{PVqyXu$GL{4lp>i-;^^oI;cyuJ{rxyQJNvWW zZ%T~CVvlrP|A{fyzPPvuQ50Q66GEUU3bNTOo;`bpP$&e)`D+(k3m+RBdtNS=UwXaX zPo}4*QK?j1L;HL_WHK2flSu>u0mNc4n5OxUXZY(XT`HBn*LD5z($dmo zf#c(21cO0@LLt;@wf9%!hkCkPF2DAAy^oidmth!&YiO_6i)=OvRaMd1*@=;nk!u$L ze+B(i)3hVUaoQ#)Ct( zNs`(WMftU%PfkJzY}>}_>M95!I;HgaP3VTHI3WZ(J3H`rJP<|k+f*v`>b9JFhx0s- z_4Rd_rdfMCh+18F0C0MG$}G!bZvJ>Bgpgvf$d^hbNRsr1Qu;zs6s_+3a5&6N(`5J6 mC4wMaNRrf@PNy&KlK2Naca=q|x;T>n0000P)OR-#W95A vda?iuQ`@iq|NlF7{13SH-%;TjBMZZmX?bBin$}N&${0Ld{an^LB{Ts5=rt`m diff --git a/src/block.cpp b/src/block.cpp index c434fea..c961fa1 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -11,7 +11,7 @@ Block::Block() : Object() { setMass(0.f); // déplacement de l'origine au centre du bloc - sprite.setOrigin(sf::Vector2f(Constants::GRID / 2, Constants::GRID / 2)); + sprite.setOrigin(sf::Vector2f(Constants::GRID / 2, 46 - Constants::GRID / 2)); } Block::~Block() {} diff --git a/src/object.cpp b/src/object.cpp index a0a280e..6a62b3f 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -316,5 +316,12 @@ void Object::setLayer(int set_layer) { } bool ObjectCompare::operator()(ObjectPtr const &t1, ObjectPtr const &t2) const { + if (t1->getLayer() == t2->getLayer()) { + sf::Vector2f t1_pos = t1->getPosition(); + sf::Vector2f t2_pos = t2->getPosition(); + + return t1_pos.x > t2_pos.x || t1_pos.y < t2_pos.y; + } + return t1->getLayer() > t2->getLayer(); } diff --git a/src/player.cpp b/src/player.cpp index 997ad8d..d4d5a35 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -58,18 +58,25 @@ sf::Vector2f Player::getForces(const Manager& manager, const std::vector