Triet Chau's Forum Posts

  • R0J0hound: Your solution works great, thank you.

    Nimtrix: Thank you for your solution, it also works

  • Hi,

    Please take a look at my capx

    I plan to create 5 planes to fly to clicked location. However, there are way too many planes created and I could not figure out why.

    Please can you help my explain it? Thank you very much

  • Hi sqiddster,

    After getting rid of all wait action, the result is still the same.

    Local variable count = 0

    For "attack" from 1 to 5

       Spawn a bullet

       Increase "count" by 1

       System pick the "count"th bullet

          bullet.Set angle to(targets.At(count))

    Thank you very much.

  • Correct me if I am wrong, but I have do things like this

    For "a" from 1 to 6

        Add 1 to "variable"

        Text -> Append "variable"

        Wait 2 secs

        Spawn object

    Expectation: Variable is increased, its value is printed, object is spawned

    Reality: Text's content is 123456, after 2 seconds, objects are spawned.

    I conclude that each statement in For loop is executed times before the next statement. It is strange compared to other language.

    Can you explain it to me?

    Thank you very much

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sqiddster thank you for the response.

    I changed it to 'set angle'. Now the 1st bullet can fly to a target, but the other won't. Moreover, they are still spawned at the same time

  • Hi all

    In my game, I have 5 targets and a gunner. The gunner is supposed to

    1) shoot 5 bullets to all of these targets.

    2) wait a second after each shoot.

    The target's angles are saved to an array called "targets"

    This is how I do it

    Local variable count = 0

    For "attack" from 1 to 5

       Spawn a bullet

       Increase "count" by 1

       System pick the "count"th bullet

          Rotate to targets.At(count)       

       System pause 1 sec

    Here are the problems

    1) Only the 1st bullet flies to the target, the other bullets stay still right where they are spawned.

    2) There is no pause between the spawning

    Can you help me out?

    Thank you very much

  • So sorry, I have fixed the link

  • link to my previous solution

  • Hi all,

    I have a picture of a table consists of equal white squares

    I also have a black square, whose size is equal to those in the table, that sticks to the cursor. The black square will snap to the grid above.

    I want that a black square is spawned whenever I click on a square in the table. My previous solution is to create a lot of sprites that look like a black square and place each of them in where users choose to.

    I would like to take a different approach to the problem, using instances. Now when I click, the new square will also stick to the mouse, while I want it to stay in the background to mark where user has clicked.

    I have read about UID, IID,

    this thread but I have not found anything promising.

    Can you please help?

    Thank you very much

  • Here is my game's script

    1. Players are asked to put an aircraft carrier (AC). They can press A or D to change the shape of the AC

    2. They select 6 targets for the AC to attack

    3. The airplanes take off, one by one, fly to the target

    I am trying to make things become more realistic, the aircrafts should fly consequently, turn to the target, shoot missiles and turn back to the AC.

    Here is the link to my capx

    This is my first game by Construct 2, so I would love to hear any comments from you.

    Thank you very much.

  • Hi I have several instances and I want to manipulate all of them using For Each. The point is, although all the tasks are the same, I want to make each instance do them consequently, not simultaneously. I tried to put a System pause action in the end of the loop but it did not work.

    Thank you in advance

  • Oh I've got it, I have to delete it in the Project window.

    Please help me delete this topic.

    Thank you

  • Hi all,

    I have googled "object in add action but not in objects windows site:scirra.com" but there is no promising. Here is my issue.

    I have several objects appear in the Add Action window but they are not visible in Objects window. I can still assign actions for those object, but I do not see them in any layer

    I have also received the error: No default instance when creating objects.

    How can I delete these object?

    Thank you

  • Thank you Kyatric

  • Thank you Ashley

    I have a code background, so basically is there any { } to embrace a code packet in Construct 2 that only allow one block to do at one time.

    Best regards