AllanR's Forum Posts

  • without seeing your code, I would guess that some condition is true for multiple ticks which results in the results be sent multiple times.

  • make the sprite a container, and add the json object to the container. Then the json object will be automatically picked when you pick the sprite.

    Edited by mod to add the link to the containers manual article

  • I quite often do something similar, but instead of using a listbox, I use a text input box set to be a textarea. This updates as things happen and allows you to scroll through the output. Just remember to append a newline at the end of each message.

    another thing you can do is output messages to the browser console.

  • You do not have permission to view this post

  • so, instead of Pick by evaluate, I guess the best option is to use "For Each Sprite order by Sprite.pv descending"

    and then stop the loop when loopindex is 1.

  • use AJAX, and "Request project file".

    then when the request completes, load AJAX.LastData into the array.

  • glad to help!

    I don't live too far from there... we might be neighbours!

  • you can use the System Pick by Evaluate to get them sorted into the right order

    "Pick Sprite by Evaluate Sprite.pv"

    then you can get the second last one by either picking the nth instance in a sub event, which would be "Pick Sprite instance Sprite.pickedcount-2"

    (-2 because instances start at 0 for the first one)

    or you can directly access the variable by saying Sprite(Sprite.pickedcount-2).pv

    EDIT: I just tried again, and pick by evaluate is not working the way I remember... I will post again when I can...

  • that is not a bug.

    when you use touch, all objects touched will get triggered. Your event sheet checks the pink one first, then the blue one second. Since it is the last one checked, it is the last one to get moved to the top, even through the pink one is getting dragged. Drag and drop will pick the top instance, but any other objects will know that they were touched as well. Even if they are not visible, or on a layer that is not visible.

    what I normally do is put objects that respond to touch commands in a family, and then check for "on touched object" for the family, then have a sub event pick the top instance.

  • Many years ago I made an Angry Birds like demo in C2, and remember having trouble getting the pieces to stop moving. So, I thought I would load that into C3 and see what happens.

    After playing around for a while I got it to work pretty well. I have it dim the brightness of pieces that haven't gone to sleep and have a timer running to show how long it takes for them all to stop moving.

    The first level has 68 physics objects and it takes about 7.5 seconds to get all the pieces to go to sleep. The second level only has 8 objects and they go to sleep in less than half a second.

    You can take a look at what I did here:

    https://www.rieperts.com/games/forum/AngryBirds.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would use an instance variable - and store the UID of the object used in the move-to command.

    another way might be to check to see what instance the moving object is overlapping when it arrives, but since you already know when the move-to command is issued, it is less work to just pick that object by UID (by the instance variable) when the time comes.

  • LAYER 1 should be transparent so that you can see layers underneath it.

  • invaderjumpsize starts off equal to 10. But it never changes, so they only move to the right. You would have to set it to -10 somewhere if you wanted them to move left.

  • I tried it in both C2 and C3, and got the same results as you.

    then instead of using instance variables on the Luke sprite I used global variables and then the keypresses worked the way you want.

    so that leads me to believe it is a picking issue. Since the instance variable is not set while the key is down, the Luke sprite is not picked, so the simulate control does not get executed.

    I would think this is a bug in C2 and C3.

  • each time you click the save button, the state now includes the contents of the dictionary, so the size of the new state is much larger then the previous click.

    where you show the dictionary.AsJSON, I changed to len(Dictionary.AsJSON) & ": " & Dictionary.AsJSON

    it goes from about 1k on the first click, to about 7k on the second click, to 30K, 151K, 800k...

    I tried adding a Clear Dictionary action before you do the Save, and still grew in size very quickly. Not sure if that is a bug in C3 or not...