dop2000's Forum Posts

  • So you need to arrange them in a grid, like an inventory? There are plenty of examples of how to do this.

    Here is a simple loop:

    Result:

  • fisholith Oh, I'm sorry, my mistake. It's just at the first glance your comment looked very similar to what ChatGPT generates when I ask it programming questions. I can see now that it's not, apologies again.

    Although I don't understand why your proposed solution is in Javascript. It's clear from the OP's post that they are using the event system.

  • fisholith What's the point of posting AI-generated responses?

  • Are all sprites the same size, and have the origin point position in the same spot?

    Check out this demo:

    howtoconstructdemos.com/select-and-drag-multiple-images

  • Yeah, first you set path to SongName&".Stamps" , after that you can access the array using just "."

    To cycle through the array:

    Local Var inRange=0
    For "n" from 0 to JSON.ArraySize(".")-1
     If CurrentDuration between values JSON.Get("."&loopindex&".start") and JSON.Get("."&loopindex&".end")
     ----> Set inRange to 1
     ----> Stop loop
    
    If inRange=1 : Set "Sing" animation
    Else : Set "Idle" animation
    
    
  • I would use MoveTo behavior, it's a lot easier. You can feed it all waypoints at once and it will move along the path.

  • After "Wait 4 seconds" action create this sub-event:

    System Repeat 10 times
    ... Wait 0.1*loopindex
    ... Spawn projectile
    
  • I find it easier to call functions by name in scripting:

    runtime.callFunction(localVars.fName);

    or

    runtime.callFunction(localVars.fName, localVars.parameter1, localVars.parameter2,...);

  • Or do you need to arrange them differently? Post a picture of what you have in mind, or a video of a similar game.

  • Check out this demo:

    howtoconstructdemos.com/template-for-a-card-game-shuffling-a-deck-of-cards-dealing-cards-to-two-players

    It may not be exactly what you are asking, but it shows how to sort and re-arrange cards.

  • XHXIAIEIN Neat idea! You can instantly see what each trigger does, without clicking and checking its variables.

  • so, im making a drifting game and i wanna make it so when your moving, it plays a sound once, but when your speed=0, it stops, how do i do this?

    You question has nothing to do with the topic. Make a new post in How do I subforum or ask on Discord.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I asked ChatGPT to decipher this post:

    Yeah, I get what they’re asking. They’re making a pack-opening simulator (like for a collectible card game) and want to add a deck builder. The issue they’re facing is displaying a list of cards in a searchable way without gaps, while also making sure cards with a quantity of zero don’t appear.

    Breaking Down the Problem:

    • Listing cards for a search → They need a way to display all the cards they own.
    • Hiding cards with zero quantity → If a card isn’t owned, it shouldn’t be listed.
    • No gaps → If a card is removed, the list should shift up to keep things tidy.

    Cameron9990 Is this what you are asking?

  • but u have to take in consideration all objects in screen are rendered by canvas... even if the system is saying is "invisible" once in screen they are actually transparent, and believe it or not... rendering "transparency" uses more memory then actual colored pixels.

    No, you’re wrong. Check out this demo — make the sprite invisible, and you’ll see that GPU utilization stays 0% even with tens of thousands sprites.

    Besides, this whole thing is moot because I’m not creating 100,000 invisible objects with 100,000 variables. It’s a single sprite with about 100 variables — zero impact on performance.

    but is easy to remove a sprite by mistake once outside the screen.

    That’s why my sprite has big text saying "DO NOT DELETE" on it. Plus, I have only one instance of it in the Loader layout, which I rarely even open in the editor.

    thats why i suggest better use json, arrays, dictionary anything that its purpose is to keep number values, text values by default.

    Oh, I do. I have about 30 different JSON objects. But for frequently used values, instance variables are much more convenient.

    but considering C3/C2 is mainly used for tablets and phones, i know from past experiences sprite objects, and many instance variables on them, will glitch, like the variables will fail to be read and written.

    No, that never happens. These so-called "glitches" are always due to user error.

    especially a sprite is easy to delete by mistake, or change its designated state by simply adding it in a familly by mistake, and then "woops" the familly gets destroyed when shot

    Just like you can accidentally delete an array, dictionary, or global variable?

    These things are easily avoidable if you just pay a little attention to what you’re doing.