codah's Recent Forum Activity

  • And then you have to know/remember to 'save as' project again. Things are only obvious once you know them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can have a very large layout, which is much bigger than the viewable screen (viewport, or 'window size' in project properties) and generate your planets at random x,y locations at startup. Only onscreen objects (in the viewport) are rendered so its feasible. Or you could have multiple 'zones/levels' (layouts) to break it up, and switch between them during the game. Is that what you're after? You can store your names (or other level data) in JSON text files and load them dynamically. I have not done such large layouts so I'm sure others will chime in.

  • I think you're complicating things. I also come from an OO background. C2 does have some OO concepts. Consider the following:

    Object Types:

    An Object Type is kind of like a class, with class variables (called instance variables in C2).

    Setting 'instance variable' values on an Object Type (via the properties in the editor or programatically) sets them for new, spawned Object instances.

    You cannot have an Object Type 'inherit' another.

    Objects:

    An Object is an 'instance' of an Object Type.

    Setting 'instance variable' values on an Object instance (via the properties in the editor or programatically) sets them for just that Object instance, overriding the Object Type.

    Families:

    A Family is kind of like an abstract class, with class variables (called Family instance variables).

    Object Types can 'inherit' from these by placing the Object Type into a Family (or more than one Family, for 'multiple inheritance').

    You cannot have an Family 'inherit' another (cannot place a Family in a Family). So 'inheritance' is only one level deep.

    Setting 'Family instance variable' values on an Object (via the properties in the editor or programatically) sets them for just that Object instance, overriding the Family.

    Note: Effects and Behaviours work similarly to Instance variables on the above.

    Apologies for any mistakes in the above, which I'm sure I'll be corrected on

  • 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

codah's avatar

codah

Member since 30 May, 2014

Twitter
codah has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies