# tacticalsk8er

Member Since 26 Apr 2012
Offline Last Active Aug 11 2013 05:51 AM

### In Topic: Smooth Collision For A Tds Game

18 May 2013 - 08:16 PM

Ok I see now how that would work. I am going to try ThatDudeOverThere's code and let everyone know if it works.

Edit: The code ThatDudeOverThere provided results with the same problems has any of my other methods.

### In Topic: Smooth Collision For A Tds Game

18 May 2013 - 06:55 AM

Maybe this will work:

```var dir_x, dir_y, i;
dir_x = (keyboard_check(ord("D"))- keyboard_check(ord("A")));
dir_y = (keyboard_check(ord("S"))- keyboard_check(ord("W")));

for (i = 0; i < 4; i += 1;) {
if !(place_meeting(x + i * dir_x, y + i * dir_y, obj_wall)) {
x += i * dir_x;
y += i * dir_y;
}
}
```
I don't think that will work because you are multiplying a integer by a boolean.

In GameMaker it does not make a difference.

Can you explain how that doesn't make a difference?

### In Topic: Smooth Collision For A Tds Game

17 May 2013 - 10:12 PM

Sorry double post.

### In Topic: Smooth Collision For A Tds Game

17 May 2013 - 10:12 PM

Maybe this will work:

```var dir_x, dir_y, i;
dir_x = (keyboard_check(ord("D"))- keyboard_check(ord("A")));
dir_y = (keyboard_check(ord("S"))- keyboard_check(ord("W")));

for (i = 0; i < 4; i += 1;) {
if !(place_meeting(x + i * dir_x, y + i * dir_y, obj_wall)) {
x += i * dir_x;
y += i * dir_y;
}
}
```
I don't think that will work because you are multiplying a integer by a boolean.