need help with a sokoban clone
in
Programming Questions
•
1 year ago
I need a bit of help, I have most of the code, It's just this one bit that's puzzling me.
- void objcollenemy1() {
- if (dotX+25 >= enemyX-25 && (dotY == enemyY)) {
- enemyX++;
- enemyX++;
- enemyX++;
- }
- else if (dotX-25 <= enemyX+25 && (dotY == enemyY)) {
- enemyX--;
- enemyX--;
- enemyX--;
- enemyX--;
- }
- }
the box moves to the right side of the dot, Instead of being pushed by the dot. It works when you go to the left of the box.
I know it's something to do with the Y co-ordinates, but it's baffling me.
here's a link to the source and executable:
thanks in advance.
1