rosedestemps's Forum Posts

  • 5 posts
  • Hi guys,

    these is where I'm with my issue.

    I've used the angle(x1, y1, x2, y2) / atan function to generate the rotation angle depending on x,y coordinates of the touch action around the piece.

    Unfortunately, controls are still impossible to use on mobile, it jumps from one angle to another without distinctions.

    I've attached my current test...

    Any ideas of the kind of math function I can use ?

    I guess there is probably a solution with cosinus using 3 points : x,y and image point - but I don't know how to build it...

    Many thanks for you through !

    Rosedestemps

  • Hi blackhornet,

    many thanks, that's what I'm looking for

    I had in mind it will have been much harder to do !

    Cheers,

    Rosedestemps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi blackhornet,

    thanks for your reply.

    I had in mind that families will only keep all the objects in the same time ?

    How is that possible to detect a used object coming from family ? with UID ?

    if I had to develop what I would like to do with another language, I would have created something like :

    var activeObject:Number;
    myObjectsTable=[object1, object2, object3];
    myAlphaTable=[10, 30, 50];
    
    function detectAction(objectSelected, animationSelected, normalAnimation) {
    for (i=0, mytable.length, i++){
    activeObject=i;
    if (objectSelected.clicked == myObjectsTable [activeObject]){
    objectSelected.alpha=myAlphaTable[activeObject]; 
    if(objectSelected.alpha == 10 || objectSelected.alpha == 30){
    play AnimationSelected; 
    } else {
    play normalAnimation;
    }
    }
    [/code:2xj6yipy]
    Thanks for your help !
    Rosedestemps
  • Hi guys,

    I'm trying to make function with several parameters to optimize my code created with Construct2 interface, but I don't understand how it works properly...

    For example, I've 10 different sprites objects which have the same behaviour with different settings like :

      each time one of this 10 objects is clicked, this object is alpha 10, 30 or 50%. if this object is 10% or 30% alpha, play animation A, else, play animation B.

    On my point of view, I can obviously copy and paste with the interface the same code for each object like :

    object1--> is clicked --> alpha 10% or alpha 30% & play animationB1 --> else --> play animationA1

    object2 --> is clicked --> alpha 10% or alpha 30% & play animationB2 --> else --> play animationA2

    object3--> is clicked --> alpha 50% play animationA3...

    but that isn't optimized.

    So, I would like to create a function with the interface like :

    function detectAction(objectSelected, animationSelected, normalAnimation) {

    with this [this is the objectSelected parameter of the function and can be set dynamically, for example with a object list coming from a table]

    if this --> alpha == 10 or alpha==30

    play AnimationSelected

    else

    play normalAnimation

    }

    so I would like the function execute the code for an equivalent of "this" where this is dynamical.

    Like that, I can reuse the function in several case, in for loop...

    but I don't understand how to call an object name dynamically and I don't see any "this" equivalent.

    Could you help me ?

    Many thanks,

    Rosedestemps

  • Hello,

    I'm currently developing a tangram game and I'm trying to make rotation on each puzzle piece with gesture detection on screen (touch / mobile).

    At this stage, I see 2 different possibilities to do it :

    1. one active piece is selected and the rotation of the piece depends on the rotation gesture speed around the piece

    2. piece is selected with one finger and the second finger make a rotation around the piece for the rotation degree.

    I had a look on this 2 plugins :

    but I don't think it can help a lot...

    Any ideas on how I can do this ?

    Many thanks for your help,

    Rosedestemps

  • 5 posts