ramones's Forum Posts

  • You have a number variable instead of text. Also you can store the array as a single JSON string instead of specifying each individual element.

  • I'll try to explain how I would do it...

    You make all the piano keys instances of the same sprite with an instance variable note to store the name of the note.

    Then you have two variables: solution to store the answer and input to store the player input.

    So at the start you set solution to a random sequence of notes.

    solution = "cdecd"

    When the player clicks a key then you add its note value to the input string.

    Say the player clicks the c key:

    input = "c"

    Using the text expressions: len(text) and left(text, count) you compare the input to the solution.

    The length of the input is 1 so you compare it to the first character of the solution.

    Then the player clicks "d". You add that to the input so the input is now "cd" - length 2. Compare to the first two characters of the solution.

    Keep going until the input is the same length as the solution and it matches.

    If at any point the input doesn't match the first n characters of the solution then they have clicked the wrong key.

  • Store the UID of the target - say as an instance variable on the bullet - and when the bullet collides with a sprite you can check its UID and see if it matches the stored value.

  • It should look like this:

    [attachment=2:34n56jmr][/attachment:34n56jmr]

    And not this:

    [attachment=1:34n56jmr][/attachment:34n56jmr]

    Also in Chrome you can view the value saved in local storage:

    Open the Dev tools (F12). Select resources from the top bar and then click Local Storage on the left. See if you have the correct value stored there.

    [attachment=0:34n56jmr][/attachment:34n56jmr]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make sure you're setting the local key to totalkills (the variable name) and not "totalkills" (a string).

  • Yeah sure, no problem.

  • The animation speed is negative when playing the animation backwards. You keep setting it to a positive value so it gets stuck.

  • In events 57/58 the LedgeSprite is being pinned to Sprite9 every tick as long as LedgeSprite is overlapping MoveSprite. You only want to pin it once. If the ledge sprites are always fixed to the ends of the shelf you can pin them 'on start of layout'.

    What's happening here is that the shelf moves to the right and the ledge sprite gets pinned a little further back every tick until it's no longer overlapping the MoveSprite.

  • Just like this:

    [attachment=0:2e8e3cix][/attachment:2e8e3cix]

    That will set total_noir to the number of sprites that have that boolean set. I think you have problems in your other events though.

  • You probably shouldn't pin the LedgeSprite to the Sprite9 every tick. And do you have more than one Sprite9? If you have another Sprite9 the second LedgeSprite is probably being pinned to it because you're not specifying which Sprite9 to pin to. That would explain why it's not moving.

  • Pick all family objects that have the boolean set to true and then use the Family.PickedCount expression to check how many there are.

  • When you spawn a stone inside the loop then you can't pick it until that event finishes. (You can pick a newly created object by UID only). Those new stones you spawn won't be picked by the 'Pick all' condition.

    I'm guessing you have one stone on the layout at the start and you call this function to create more but it's only able to pick that first stone. You'll have to try a different approach.

    For example, you could spawn all the stones first, in a different event. Create all stones at (-1000, -1000) with boolean flag placed = false. Then you can have your loop that would be almost the same but instead of spawning stones it moves one of the unplaced stones to the correct position.

  • These look great. Thumbs up for big GIFs.

  • Here's the LayerToCanvas/CanvasToLayer approach if you want to see that.