Need more information on event "on collision with object"

Discussion and feedback on Construct 2

Post » Tue Sep 09, 2014 8:00 am

Hi All,

I am new here and i dont have any programming knowledge. However, i impressed with Construct 2 platform so i started development of my dream game.

I just have a little query.

I wanted to see if there any workaround for event on 'collision with another object'. i have used this event to restart layout from start when ever my dragon collide with ground.

i want this behavior with many object, currently i require to add always new event for every new object with whom i want to restart the layout after colliding with it.

can any one help me with this?

thanks in advanced.

TABREZ
B
16
S
4
Posts: 53
Reputation: 1,221

Post » Tue Sep 09, 2014 9:25 am

Ideally, you want families. Objects grouped into a family behave as one object for the purpose of events. That's a simplification of their functionality, but it'll work for your current needs.

For example: put your ground, pillars, obstacles, enemies and whatever else you want into a family, call it "obstacles" or something. Then create an event that says something like Dragon: On collision with Obstacles > System: Restart Layout. This will check if the dragon collides with any of the objects in the Obstacles family.

Families are only available in a purchased version of C2. Otherwise you'll have to either create multiple events, or use a collision detection object that wraps itself around all obstacles, and just check for collision with that single object.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Tue Sep 09, 2014 11:17 am

@Thanks GeometriX for this information. could you please provide more information on "use a collision detection object that wraps itself around all obstacles, and just check for collision with that single object." ?

Thanks
B
16
S
4
Posts: 53
Reputation: 1,221

Post » Tue Sep 09, 2014 11:37 am

Hah, I feel like an NPC in a text parser game :P

An illustration is probably easier:
blocks.png


So, everything in there is an obstacle: the ground, some pillars, a box, etc. The red transparent objects are your "blockers"

Then what you do is create a "blocker" object that that fits around those obstacles. You only need to test collisions against that blocker object, instead of every individual object.

These blockers could be created at runtime through a series of events, or manually, depending on how your levels are built, but that bit's up to you ;)
You do not have the required permissions to view the files attached to this post.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Tue Sep 09, 2014 1:30 pm

oh.. thanks for this trick ;)
B
16
S
4
Posts: 53
Reputation: 1,221

Post » Sun Sep 21, 2014 4:57 am

Hey, can you help me,,

i am working on bike racing game, but i am not able to get total distance travel count for score hud.

Can you help me with this?
B
16
S
4
Posts: 53
Reputation: 1,221

Post » Tue Sep 23, 2014 6:27 pm

cooltaby wrote:Hey, can you help me,,

i am working on bike racing game, but i am not able to get total distance travel count for score hud.

Can you help me with this?


If its side view you can make on race end write in textfield with score "distance(start.X,Start.Y,Player.X,Player.Y)"
Creator of MiniDayZ
B
22
S
2
G
2
Posts: 75
Reputation: 1,858

Post » Wed Sep 24, 2014 11:11 am

Thanks for this :),,,

the day by day i am loving and addicting to construct 2. I just have one query if this possible can we add and implement facebook feature same like subway surfer?

main thing i wanted is game should display friend name who is playing the same game and its high score.

i tried with clay but not luck for this feature.

It will very help full for all.

Thanks
B
16
S
4
Posts: 53
Reputation: 1,221


Return to Construct 2 General

Who is online

Users browsing this forum: monikarr6 and 16 guests