0 Favourites

Need more information on event "on collision with object"

  • 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

  • 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.

  • 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

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

    An illustration is probably easier:

    [attachment=0:2w5tkya2][/attachment:2w5tkya2]

    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

  • oh.. thanks for this trick

  • 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?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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)"

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)