codah's Forum Posts

  • Can someone give me an example of a practical use for an array in a game?

    Arrays are probably the single most powerful construct in any programming language, including C2. The following are just trivial examples.

    A 1D (1 dimensional) array can store (and allow you to easily retrieve) a list of numbers or text.

    A 2D array is like a grid and so is good at storing, e.g. a level full of things that you can easily access via x,y coordinates.

    3D arrays are useful but less common IMO, you might use them to extend your 2D levels to have floors as well

    They are powerful because you can go through them in a 'loop', rather than one by one. Or grab one randomly by its 'index'

  • Thanks codah - I would love these instructions for iOS with ads.

    yeah me too!

  • takes 11 seconds for a 320x240 layout on my computer

  • > There's auto save, then there's backup. Go to the Backup tab, Auto-backup: Keep up to x backups(s) in folder when saving

    >

    interesting. my bad for not diving deep enough.

    I suppose the last thing I would want that actually is not there (and if it is, it has not been pointed out) is to auto save every time you test the app.

    Only issue would be the time taken to save every time you want to preview your app (if it's a big app or even medium). If it did it in the background would be ok.

  • What's wrong with instance variables?

    PlanetSprite

    • myID: Number
    • myX: Number
    • myY: Number
    • myName: Text

    edit: added the ID. You could store the planet ID's in a 2D array mapping to your coord system. That might remove the need to store x,y in each object. But I wouldn't go the 3D array route, it doesn't seem necessary.

    sorry if this is too simplistic and I have misunderstood your needs.

  • oh it's the 187 beta version

    https://www.scirra.com/construct2/releases/r187

    here:

    the relevant stuff is in event 5

    the arrays are set to 0 width in the properties

  • Hope it helps

    [attachment=1:2k2k5xuh][/attachment:2k2k5xuh]

    edit: slight mod

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

  • I saw the manual entry for it, but I guess the part I'm stuck on is how those parameters actually get passed around. Like what does it actually look like to assign something to param 0, param 1, etc. To utilize it, it'd look something like function(x,y,z), but how do I tie x, y, and z to the contents of the function? Via local variable?

    Here's an example of calling a function with params, using them in the function, and using the returned value (if any).

  • I'm having more issues. I don't get much auto complete any more. Afghanistan is about all, if I type 'A'. Sorry..

    edit: ok so If I click the drop-down arrow, THEN choose a country from the list, then the autocomplete starts working... kind of. But it doesn't look like your screenshot

  • I think you can read PM? I'll send my email.

  • Cool. Sorry for the lack of explanation, but TBH it stumped me for a bit. What I expected to work, didn't. Bit of trial and error in the end I admit.

  • I still don't understand ... Just have an instance variable on each block, that should be enough to choose between them. But I'm really not sure, maybe you can post a sample capx.

  • Your clicked event automatically picks the clicked block.

    e.g.

    Mouse: On Left button Clicked on Sprite -> Sprite: <do something>

    The 'Sprite: <do something>' is already the correct object for you.

    Or maybe you mean something deeper..

  • Lost interest in merging your projects? If you're still interested, I have a way, PM me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you have so many to disable? Maybe you could organise groups into subgroups then disable the parent group.