Laurent's Recent Forum Activity

  • OK, I got it working. But result can make the game very very difficult this way.

    Sprites react differently to each other, depending on their speed.

    Thus, A moving on B stationary gives C

    and B moving on A stationary gives D

    This is clear when aiming at A with B, but when A and B are stacked in the game and a sprite is thrown onto the stack, A and B have 2 ways of reacting depending on the speed they take with the shock.

    This is unpredictable for the player and can be a nightmare when it comes to strategizing.

    I'm still experimenting because it's interesting.

  • I didn't manage to have it work with speed comparaison so I tried something to understand how Construct considers sprites and families.

    I have a sprite Token and an family Ball made only with a Token sprite.

    In this example, Token falls from the top of layout when clicked on. When it collides with another Token, test is :

    -Token on collision with Ball

    i made a test to see how Construct considers the sprites, as Token or Ball and then write either state on the sprite.

    Most of the time, faling sprite is considered as Ball and motionless sprite as Token.

    But it appears it is not that simple, because sometimes it can be the other way or even two Token or balls...

    File is here :

    dropbox.com/scl/fi/dhbsl4so4nob83ynz9rxw/jeu.c3p

  • How do I compare speed ? I found this formula (in one of your post I guess), will it do ?

    Speed = distance(0, 0, object.physics.VelocityX, object.physics.VelocityY)

    And most of all, how do I consider the two colliding sprite instances among all the instances that are in the game ? So far, I used the trick of having a sprite and a family with only this sprite but I guess there's a smarter way to achieve this.

  • Actually, since dragndrop is disabled on active sprite, I only have one event left : on collision

    Logic should consider two equivalent sprites that differ only by their velocity. Active sprite is the one with higher speed.

    What about something like :

    - when instance A of Sprite collides with instance B of Sprite

    - Compare instance A speed to instance B speed.

    - If instance A speed > instance B speed -> destroy both sprites and create instance Sprite C with animation frame 1

    - If instance A speed < instance B speed -> destroy both sprites and create instance Sprite C with animation frame 2

    result of speed comparison is not a problem but I have a hard time creating the mechanics to set this comparison up.

  • Actually, sprites are dropped from the top of the screen and pile at the bottom. So when falling sprite collides with another, its dragndrop behaviour is disabled since drop had occured. And more, when a sprite falls, it can shake the whole pile and create a chain reaction of collisions.

    So we can assume that maybe, active sprite is the one that has motion and passive the one that has not (sprite has physics behaviour). And if both are in motion, active one is the one with the highest speed

  • I'm making a craft game.

    Basically, when a sprite collides with another sprite, a new sprite is created.

    All elements of the crafting game are stored as animation-frames of a single sprite.

    Thing is who collisions with who is relevant :

    - water poored on fire = coal

    - fire thrown on water = steam.

    So I need to know which sprite is active and which one is passive.

    So far, I have a sprite 'Element' and a family made of this unique sprite called 'Elements-fam'.

    When I check:

    - 'Element': on collision with "Elements-fam"

    Am I sure that Element is the active one and Elements-fam the passive one ?

    Note that :

    - passive sprite can be in motion

    - after collision, passive sprite can be considered as an active sprite if collision with active sprite sets it in motion. A chain reaction may occur

  • You can use the Advanced Random plugin to create a probability table.

    Thanks.

    Do you have an example for this ? I had a look and it seems quite obscure to me

  • Choose expression is very interesting but every item in it has the same probability to come out.

    Is there a possibility to add probability so that when Choose(a,b,c) is called, I have 50% chances to have 'a' and 25% chances to have 'b' or 'c' ?

  • I found a way to have it working using family

    - Red sprite is in Red family

    - When Red sprite collides with Red family instance, create a new sprite at the middle of Sprite and Family instance position. Construct uses coordinates of both elements involved in collision and everything works fine :)

  • I actually gave it a try with family, but when destroy action occurs, every instance in family is also destroyed :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I make a simple game with colored balls falling from the top of the screen. When a red ball collides with another red ball, a green ball is created right in the middle of the segments connecting the two red balls centres and both red balls are destroyed.

    Logic is not a problem, I'm just looking for a method to get red ball's (0) and Red ball's (1) instances coordinates in order to calculate the green ball's coordinates.

    Green.X=abs(Red.X(0)-Red.X(1))/2

    Green.Y=abs(Red.Y(0)-Red.Y(1))/2

  • > Chadori how about this problem?

    > could not find included file '/Pods-GameName.debug.xcconfig'

    Click the link below to visit the page with steps to fix.

    https://github.com/Scirra/Construct-bugs/issues/6934#:~:text=Steps%20to%20fix,now%20be%20successful%3A

    Here are the steps:

    1. Open the terminal
    2. cd to directory of the Xcode workspace folder.
    3. Type in pod install
    4. Relaunch Xcode and reopen the workspace, then click the play button. The build will now be successful.

    Hello

    I'm very interested in your solution but when I type 'pod install' in the Terminal, answer is 'command not found'. Did I miss something ?

    I'm quite a newbie in using terminal and maybe a complete walkthrough made for beginners would be very useful.

    thanks !

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies