# Questions about the solid behavior

Get help using Construct 2

### » Thu Apr 04, 2013 1:56 am

Haven't done this myself but if bullet behavior nullifies solid behaviour, you might want to consider a standard movement method and mimic the bullet behaviour in your events. If you just want them to go towards a straight line you can use linear algebra to set their positions.
B
19
S
6
G
1
Posts: 116
Reputation: 2,730

### » Thu Apr 04, 2013 3:01 am

[QUOTE=rosareven] Haven't done this myself but if bullet behavior nullifies solid behaviour, you might want to consider a standard movement method and mimic the bullet behaviour in your events. If you just want them to go towards a straight line you can use linear algebra to set their positions.[/QUOTE]

Bullet behavior seems to work together with solid only if between two different objects. They dont work between instances of the same object.

Here is my capx, and the methods done by Yann to help me out. Got some problems though. I commented it inside. https://dl.dropbox.com/u/98441819/Construct/Zombieland/zombieland.capx
B
5
Posts: 14
Reputation: 528

### » Thu Apr 04, 2013 3:27 am

I dont think there is an edit button here so i just made another comment.

After a bit of testing:
two instances of the same sprite (with solid behavior only) each controlled by different keys:
solid does work between two instances. I use bullet behavior for my monsters so they always chase the player. Any ideas how I can mimic this behavior without using bullet behavior?
B
5
Posts: 14
Reputation: 528

### » Thu Apr 04, 2013 3:31 am

Have your monsters always face towards the position of the player while moving forward. Sprites can use the actions "set angle toward position" and "move forward". Copy the player's x y coordinates for the angle to follow.
B
19
S
6
G
1
Posts: 116
Reputation: 2,730

### » Thu Apr 04, 2013 3:45 am

That worked, but apparently they did overlap again. I dont know why this happens. I only have 2 sprites, one player one enemy. There are two instances of enemy and one player on my layout. player has 8direction behavior while enemy has only solid behavior. But they still overlap.

Then, I tried putting 8behavior on the enemy. Amazingly, they worked. I can control my player using WASD and the monster follows me and they dont overlap. Only problem now is how to make the arrow keys null when pressed so they wont move. Here's a sample capx.
https://dl.dropbox.com/u/98441819/Construct/Zombieland/sample.capx
B
5
Posts: 14
Reputation: 528

### » Thu Apr 04, 2013 3:53 am

Okay nvm. I fixed it all now, Thanks for all the help!
B
5
Posts: 14
Reputation: 528

### » Thu Apr 04, 2013 3:57 am

Here's the final outcome. They still glitch-teleport when crowded.
https://dl.dropbox.com/u/98441819/Construct/Zombieland/zombieland.capx
If you know how to fix this please tell me.
B
5
Posts: 14
Reputation: 528

Previous