Problem with solid sprites -> teleportation ?

For questions about using Classic.

Post » Sun May 31, 2009 6:16 pm

Hi guys :)
First I apologize for my bad english, I hope someone can understand what I'm writing ^^'

I have a problem with at least 3 sprites with the attribute "solid".
The first is just a wall, he can't move.
The second has the behavior 8 directions.
The third has the behavior bullet and has for direction the second sprite.

The problem I have is when my 8 directions sprite is blocked between the wall and the bullet. If I try to move, he is teleported behind the bullet, or behind the wall.
Why ? How can I avoid this ?

If this problem was treated in another post, I'm really sorry I didn't find it (wrong words in the research ? ^^'), so if someone could redirect me...
Thanks a lot :)
B
2
G
3
Posts: 4
Reputation: 858

Post » Sun May 31, 2009 6:26 pm

Upload your .cap so someone can have a look.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun May 31, 2009 6:51 pm

Yeah this is :
http://dl.free.fr/qlPdTPPfp
Thanks :)
B
2
G
3
Posts: 4
Reputation: 858

Post » Sun May 31, 2009 7:14 pm

Okay, as far as your bullets go, there is an easy fix: DON'T make them Solid :). They don't need to be Solid. They work just fine when they are not solid.

As for your black hearts... there is not a lot you can do about that if you want them to push the player. If two hearts push on the player from different directions, you will get strange results. The player will teleport, or jitter, or get stuck.

There a few things you can do to fix this:

1. Do not make enemies or bullets solid. Make only the player solid, and any walls or obstacles that do not move. As a general rule, if an enemy or a bullet is moving, then you probably should not make it solid.

2. Use Physics instead of 8Direction on your player, and use Physics instead of Bullet on your hearts. (You will have to make them move with events.) That way they can push each other around all day and it will work properly. Physics behavior is made to have solid collisions with many moving objects, Bullet behavior is not.

3. Write your own custom collision routines with events. This is not recommended for beginners.

Good luck :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun May 31, 2009 7:23 pm

Ok, I'll try the second solution, the goal is to destroy black hearts before they push you on the left.
Thanks a lot :)

(and thank you for your tutorials, thez were very helpful to me :) )
B
2
G
3
Posts: 4
Reputation: 858


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests