Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void controleerBotsing(String kleur)
- //doet een controle of 1 van de bomberman's enige andere bomberman overlapt
- //zo ja dan wordt botsing true en wordt de verplaatsing teruggedraait
- {
- botsing = false;
- for (int positie = 0; positie < objecten.size(); positie++)
- {
- Bomberman b = objecten.get(positie);
- if(kleur.equals("Groen"))
- {
- if(Botsing.overlapt(bombermanGroen, b) && bombermanGroen != b)
- // alle bombermans, BEHALVE wanneer groen niet gelijk is aan de objecten.get
- {
- botsing = true;
- }
- }
- if(kleur.equals("Rood"))
- {
- if(Botsing.overlapt(bombermanRood, b) && bombermanRood != b)
- {
- botsing = true;
- }
- }
- if(kleur.equals("Geel"))
- {
- if(Botsing.overlapt(bombermanGeel, b) && bombermanGeel != b)
- {
- botsing = true;
- }
- }
- if(kleur.equals("Zwart"))
- {
- if(Botsing.overlapt(bombermanZwart, b) && bombermanZwart != b)
- {
- botsing = true;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment