blackr1234's Forum Posts

  • 2 posts
  • No one?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all, I am new to Construct 2 as well as game engines. I am writing a game similar to Puzzle and Dragons (I have not enough points to post the links to its simulators but you can definitely search one in Google). Please see the attached image.

    I have written it in Java but how can I do this with Construct 2? I can upload the JAR if needed.

    I have an array of 6x5 JLabels with instance variables (color, x-coordinate, y-coordinate). The is an ImageIcon for each JLabel (but we don't have such thing in Construct 2 but Sprite and Array).

    I use mouse listener and mouse motion listener to trigger user mouse click position.

    Requirements

    It will have a touch area that looks like a 2D array, so I will have an array of 6x5 which each element is given its color, x-coordinate and y-coordinate (may also attach a Sprite to it).

    On game starts, gems are having random color values and fixed positions.

    Moreover, I will need an extra gem image for the action I pickup (click on) a gem and its position follows my finger movement.

    In addition, two gem images are needed for handling the gem swapping animation. Their positions are set according to the circumference formula (points around the circle).

    The array (or Sprites) should not have position swapped. Only their color (or images) are swapped.

    Some functions I need include:

      1. Change and update image (or image location) of Sprite according to the color instance variable (just like JLabel) 2. Get the exact touch position (instead of knowing the touch over an object) (just like MouseMotionListener) 3. Get the Sprite based on touch position 4. Animation concurrency
      • when my finger moves, the picked up image moves and the swap animation function of two gems is done at the same time (animation uses for loop with circle formula to calculate x y coordinates)
      • color instance variables do not mess up (each swap has its own copy of variables)
      • speed up / end animation to prevent swap animation from not following the speed of finger movement

    Questions

      1. Can I do all these with Construct 2? 2. How do I name the instance variable of an array element? array(4)(4).var, array.At(4, 4).var, array.var(4, 4), etc do not work. 3. How to have an array of Sprite? In my situation, should I put a Sprite in each element of the array or create an array of Sprite? (I used to have an array of JLabel) 4. Can I change the image of a Sprite?

    Thanks for your time guys!

  • 2 posts