Skip to content

Commit

Permalink
Modif mineure
Browse files Browse the repository at this point in the history
  • Loading branch information
KilianHett committed Apr 26, 2012
1 parent 0046df6 commit 51083f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions jeu/controleur/thread/CollisionThread.java
@@ -1,6 +1,7 @@
package controleur.thread;

import modele.Map;
import modele.elements.Element;

public class CollisionThread extends Thread
{
Expand All @@ -18,18 +19,20 @@ public CollisionThread (Map map, MouvementThread thread)
public void run ()
{
boolean b;
int i;
while (!fin)
{
/**
* On test tout les objets de la map qui pourrait
* entrer en collision
**/
b=false;
for (int i=0;i<map_.nbElem()&&!b;i++)
for (i=0;i<map_.nbElem()&&!b;i++)
{
b = map_.getElem(i).entreEnCollision(map_.getPerso());
}
if (b)
if (b && (map_.getElem(i-1).getEtat()!=Element.ATTRAPABLE &&
map_.getElem(i-1).getEtat()!=Element.ATTRAPER))
{
thread_.collision(true);
}
Expand Down
4 changes: 2 additions & 2 deletions jeu/vue/Vue.java
Expand Up @@ -109,7 +109,6 @@ else if (e.getEtat() == Element.ATTRAPABLE)
e.getSize(), e.getSize());
}
}

}

public void enMouvement(MouvementEvent event)
Expand All @@ -132,7 +131,8 @@ public void keyPressed(KeyEvent arg0)
{
if (arg0.getKeyChar() == 'd' || arg0.getKeyChar() == '6' )
{
getControler().getMap().getPerso().setCurrentImage ((getControler().getMap().getPerso().getCurrentImage()+1)%2);
getControler().getMap().getPerso().setCurrentImage
((getControler().getMap().getPerso().getCurrentImage()+1)%2);
getControler().notifierMouvement(new Vector2f(1,0));
}
else if (arg0.getKeyChar() == 'q' || arg0.getKeyChar() == '4' )
Expand Down

0 comments on commit 51083f1

Please sign in to comment.