jmg89's Forum Posts

  • Thanks for the advice, much appreciated. Stay safe.

  • Wow XpMonster, that was quick! Thank you so much, that did the trick!

    1 more question, I struggle with math in consturct 3 can you suggest a good place to start learning it.

    I have no coding background.

  • Hi, I have 2 buttons which adds or subtracts value in variable.

    How can I play audio loop based on the var number.

    Like -

    On tap play button :

    play audio "tag" looping (var)number of times.

    Tagged:

  • [quote:14k9fvu2]The problem is here (object.id = Target.id) is not the same as (Target.id = object.id) even if they are technically the same just inverted but the results will be different, one just compares and the other one Picks

    Capx:

    dropbox.com/s/3oe5og12khuk14l/DragMatchObjects2.capx

    Aah .. finally it's solved.

    Thanks for giving your time to help and explaining the concept.

  • [quote:3t4hdzqv]

    Thanks for the comment.

    Can you please provide a capx file?

    I've even tried family, but there too experiencing same problem

    Sure, just to make sure I followed what you trying to do as is not very clear

    1-When Sprite overlaps Target and is the same Id >>> Sprite set position to the Target

    2-When Target Overlaps Target has to be the same Id or doesn't matter??

    if you can explain the steps you trying to accomplish will be easier and quicker

    The target does not have the drag and drop function.

    Only the sprite has it.

    In the file, I provided previously when I am setting the layout where both the targets are overlapping each other then the drop function does not work. When both are placed separate then the drop works perfectly.

    Works in this setting:

    Doesn't work like this:

  • [quote:q5kwupr8]When the targets are not overlapping each other it works correctly. But, when 1 target is overlapping on another target in the layout then the drop function does not work in the overlapping region.

    How to solve this issue?

    You have the Events Referencing (Sprite Vs Target) only, what you need is to create Events referencing (Target Vs Target) swell

    Will be easier if you put all the objects in a Family so you create just one Event like you did

    Thanks for the comment.

    Can you please provide a capx file?

    I've even tried family, but there too experiencing same problem!

  • Hi,

    I am making a drag-n-drop game.

    2 targets and 2 drop objects.

    I have set 1 target sprite with 2 frames and unique id set for both. When an object is overlapped on target and has the same id then it drops on it, if not then returns to it's position.

    When the targets are not overlapping each other it works correctly. But, when 1 target is overlapping on another target in the layout then the drop function does not work in the overlapping region.

    How to solve this issue?

    nofile.io/f/Hh2EnQh6tGc/overlapproblem.c3p overlapproblem.c3p

  • 1. I think you missed the condition in my demo where I'm comparing Sprite.ID=Target.ID

    This is how you define the correct drop area for each sprite - using the ID instance varible on both sprites.

    2. Instead of the global variable for incorrectDropCounter you can make it an instance variable on the family.

    Then it'll be counting incorrect placements per instance.

    If you still can't figure this out, please share your capx.

    You can pm it to me if you don't want to post the link here.

    I think I've figured out most of it.

    I request you to address these issues with my file:

    1. How to implement IncorrectDropCounter for individual frames/ID?

    2. How to show different text for IncorrectDrop for each frame individually?

    3. How to set the same events while using a family?

    Here's the file:

    nofile.io/f/A9JeMUDSQ9w/DragDropZoomFinal.capx DragDropZoomFinal.capx

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should be able to work this out for yourself from Plinkie's .capx, surely.

    Look at the Events that deal with setting the Scale value.

    Yes, I figured it out finally. Thanks for the encouragement.

  • The scale of the object after dropping changes back to 1. I want it to remain 0.5 after the correct drop.

  • Hi, I have a draggable sprite and a drop target sprite and a zoom area sprite which when overlapped by draggable object scales the layout by 2.

    The drop target sprite is located within the zoom area sprite.

    I want a scenario in which when the draggable sprite overlaps the target sprite and drops in it then the scale layout should be set back to 1.

    But this is not happening, since the drop area is within the zoom area the scale gets set to 2.

    Your help will be appreciated.

    Please check .capx file.

    nofile.io/f/21AEWuE6sYu/ZoomInOut.capx ZoomInOut.capx

  • jmg89

    Here you go:

    https://www.dropbox.com/s/28o9bf9o4rmw4 ... .capx?dl=0

    I used one sprite with different frames. You can use a family with multiple sprites if you want.

    dop2000

    Thank you. But this doesn't work if we use family.

    1. In family correct drop is working fine but the incorrect drop is not.

    Object 1 works correctly i.e. comes back to its place if placed incorrectly but when object 2 is placed incorrectly then object 1 tweens to object 2's position automatically!!!

    Also, set "drag-drop" to "disabled" after correct placement is not working.

    2. The IncorrectDropCounter does not work as expected. It shows the text even if Obj 1 is placed incorrectly twice and obj2 is placed incorrectly once. I think it is counting all objects incorrect placement combined and not individually.

    I sincerely thank you for all your help, you are a great person.

  • Hi, thanks for the reply.

    [quote:l4zhz8c9]I'm not sure how your game works and where do you get values for TargetX, TargetY.

    I have 2 objects for each set of events 1. The draggable and 2. The drop area (which is a duplicate of the draggable with opacity set to 0).

    So, like this, I have around 13 dragables and 13 drop areas.

    I set the XY position by seeing the XY position of the drop area object.

    i.e. if the object is dragged and it overlaps the drop area then it snaps to the XY position of the drop area, if not, then goes back to its original point.

    [quote:l4zhz8c9]If you have to repeat the same event more than twice, you should definitely optimize it.

    Add all sprites to a family, define Drag&Drop behaviour on the family. You'll be able to keep just one event "Family on Drop" and remove all duplicates!

    Add instance variables to the family: StartX, StartY, TargetX, TargetY

    On Start of the Layout (or On Family Created) set StartX to Family.x, set StartY to Family.y

    [quote:l4zhz8c9]On Drop - if dropped on a wrong spot, set object position to (self.StartX, self.StartY)

    If dropped correctly, set object position to (self.TargetX, self.TargetY)

    Sorry, I didn't get these. I humbly request a screenshot or .capx.

    Thanks again.

  • Hi,

    I have made a game with 41 events with help of a template. It is drag and drop, shape matching game.

    I am using "Lite Tween" behaviour which uses XY position to drop objects at the correct place and return to the original place if dropped at the incorrect place.

    I wish to change the layout of my scene, like moving the draggable to another position or the drop target to a new place.

    This messes up the game as all the XY positions in events are already set.

    Will I have to change all of them again every time I change the layout or is there a way to do it automatically without manually changing XY of all my events?

    Thanks.