mindfaQ's Forum Posts

  • System -> compare two values

  • is that case sensitive? Although it normally should result in nothing getting picked, if no match is found.

    Did you create the blocks in the same event beforehand? Iirc back in my time when I was more active with Construct, that messed up picking of objects sometimes and I had to put picking stuff in an extra event.

  • like this:

  • A = 100*(yourscreenswidth-yoursprite.x)/yourscreenwidth

    Since your hotspot probably isn't on the right side, you have to, for example, also add half of your sprite's width, if it is in the middle of it.

    A = 100*(yourscreenswidth-yoursprite.x-yoursprite.width*1/2)/yourscreenwidth

    Ofc the formula needs further tweaking, if you have a moving screen, that doesn't start with x = 0 to the left.

  • If you want each object to have its own dictionary, that would be possible with containers, too, though (if I am not mistaken). I'm not saying "you should", just "you could".

  • You can fill up the dictionary with key:value pairs, look if keys exist etc.

    You can't add instance variables as your program runs.

    So... they offer different functionalities. Use what seems most practical to you for each problem. Most of the times it will probably be instance variables, but that doesn't mean that dictionaries don't have their uses.

  • Hello guys,

    I used Intel XDK and Cordova to build an Android APP out of my construct project. So far all is working, except that I can't keep the game active in background. It needs to continue doing some stuff while its in background. Is there a way do enable that?

    On a side note, is full network access permission needed as default or can I somehow get rid of it?

  • I would say so, yes.

  • Yeah the browser crashes. I tried uninstalling, but didn't delete my personal data. I will try to delete all the personal data/files before a reinstallation later on, when I have the time. Since I noticed it happens with older construct apps, I don't think the problem is on Construct 2's side (thought it might be a new feature thats creating problems).

    edit: yes, works now. Don't know how something like this can happen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • easier:

    put all sprites you wanna count into a family

    family compare frame > 0

    family is on-screen: set spritesonscreen = family.pickedcount

  • UID and IID are different from each other. You pick by IID.

    UID is unique.

    IID only is unique along all instances of an object and gets automatically assigned starting at 0 and counting up.

    So your code would need to be

    pick instance 0 of button

    pick instance 0 of text

    pick instance 1 of button

    pick instance 1 of text

    Or you swap it with picking by UID, then your code would work as well.

    I probably would give each object an instance variable though and identify them with the help of this variable. So for example the buttons get a variable named buttonID, you set it to a different value for each button and can pick them with by comparing the instance variable.

    This will be a more descriptive way of doing things and could help you to understand what exactly the code is doing, when you come back to it later on for whatever reason.

  • Not sure what you want to do, but it sounds to me like you want to use a 1D or 2D array. Maybe it is for level properties like gravity and stuff?

    Then you could set up a gravity array, and to access it you just use gravity.at(currentlevelnumber) where currentlevelnumber is the level's index you are currently in.

  • Implying people still need screensavers. I am really a bit mind blown that some people do use screensavers still, while they ofc reduce screen lifetime (not a big factor) and more importantly waste energy (in comparison to the computer just switching off the display).

  • I've created an event like this:

    every 2 seconds:

    destroy blocks (family)

    system create blocks (family) on layer ...

    And it worked without problem. So maybe you missed to exchange one vital block expression with, at least would be my best guess now.

    I might have this totally wrong - in which case I apologise.

    Judging by the lack of a medal in your avatar I think you must be using the free version ? I don't think that families work in the free version.

    Steam users for example don't get the badge, so you can't really be sure if the persons own the personal version either way.

  • Why do you need to select a txt file for your ajax action.

    If you know the filename in the project files, just use a URL request like "item1.txt". Or if you dynamically want to go through all elements, you could use "item"&variablenumber&".txt" as filename and change the variablenumber each time.

    I'm not sure where you are stuck, especially since you bring up csv.