How do I check below my character.

Get help using Construct 2

Post » Mon Jan 28, 2013 4:26 pm

Hello I am new to Construct 2, but have used game maker before. I have searched around and to no avail found help on what I am stuck on. In the game I am creating the player has the choice to "spawn a character." Once spawned the character will drop with gravity to the floor. That's all fine. My problem is I do not know how to make the system or character check below them. For instance if their is a solid floor below them, then they can spawn and drop. If another non solid character is below them they can not. I was thinking maybe distance, but i don't know how to use it in this case.

Also there is "air" between the instances. The character is at the top and the floor is at the bottom and another character can be anywhere in between that.
B
2
Posts: 2
Reputation: 304

Post » Mon Jan 28, 2013 4:30 pm

Just off the top of my head, you could spawn an invisible line from your character downwards and see if it intersects floor. Or you could check the specific x,y of where you want the object to spawn, and see if there is floor there. gazoogle2013-01-28 16:31:49
B
34
S
4
G
8
Posts: 67
Reputation: 5,857

Post » Mon Jan 28, 2013 4:40 pm

Create an invisible line off the spawned object. It's a new sprite, invisible. It checks to collide with a floor or character. What about a small line with bullet. Think like a sonar. When you click the mouse to spawn it shoots out and if it collides with a solid then you spawn, if not no spawn. Could that work?
B
2
Posts: 2
Reputation: 304


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 25 guests