Minor's Forum Posts

  • Here's my version as posted above using a tilemap instead of Rojohound's canvas plugin.

    [attachment=0:1rcfxsw9][/attachment:1rcfxsw9]

    I've thought before that it would be interesting to try and build a literal game around it, where you started with an initial state and some sort of goal. Never really got into the specifics.

    ...and, someone beat me to it. Damn my procrastination!

    TiAm I made some prototypes in Construct Classic using CGOL for a platform game. Videos can be found

    HERE

    and

    HERE

  • I've quickly edited Rojohound's terrain gen capx to show how you can turn top sprites to grass.

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

    After generating the terrain press spacebar.

    To check surrounding tiles you'll need to loop through the array. I checked for the current cell value being "1" which is a solid then to check surrounding tiles I used CurX (this stays as it is because we're not interested in left&right surroundings) and then CurY-1 which will check "1" cell above the current cell is "0" which is air.

    If you planning on doing more like this you WILL be using bitwise numbers eventually since that has nothing to do with the fact that your terrain gen is array based it is a method of setting tiles/sprites based on surroundings.

    There is another example of mine

    HERE

    and a link to my blog post about using bitwise numbers for tiling levels.

  • Hi.

    I have a blog post that has this mechanic although set up for arrays -

    HERE

    .

    Also this post by

    Salt

    will help you understand the concept behind bitwise numbers for tiling.

    I also made some really heavy changes to you capx to show you how it can be done in your example. Using this method though might cause problems when there are lot's of tiles on screen. Either changing to the array method or only checking tiles near to the newly added tile would help. But It'll give you a starting point.

    [attachment=0:q007viac][/attachment:q007viac]

  • That's not a problem on your side. The engine crops everything if you import it as an animation strip.

    This isn't true.

    I've just loaded 2 sprite sheets into the

    same

    animation. My 32x32 sprite sheet imports at 32x32 and my 64x64 sprite sheet imports at 64x64. No cropping on either of the 2 different sizes.

    When I preview in browser the sprites size is 32x32 until it comes to the frame when the 64x64 sprite sheet starts and the sprite resizes correctly changes to 64x64.

    So unless I miss understood your statement is complete rubbish.

    Edit** Here's the sprite sheets I used

    32x32

    64x64

  • Can confirm this.

    When simply setting the "crop" option and touching no other options the UI Layer in the Top-down shooter template seems to be offset. In the debug it says it has an offset of Viewport Left -640 & Viewport Top of -66.

  • So, the problem is in number of Animation Frames? If I have like 802 possible images, i should make 802 animation frames? If it possible to add new frames during the game?

    You can't add animation frames at runtime if I recall correctly.

    You'd only need 802 frames if there are going to be 802 instances of the sprite on screen at the same time. You would have to think about how many sprites can appear and maybe a different way of storing the URL either in an array or dictionary. That way you can use the same sprites all the time but reload a new image from url into that same frame as and when needed.

    A lot depends as well on the type of game you are making.

    It's not going to be super easy to achieve what you want but with a bit of planning should be achievable.

    EDIT***

    If you don't mind the use of 3rd party plugins Rojohound's paster plugin might be a better option. But again depends on what type of game you are making.

    https://www.scirra.com/forum/plugin-paster_t88750?&hilit=paster

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

  • You'll have to use the built in expression "CurX" if using the built in "For Each X Element"

  • Here's a working example.

    [attachment=0:3sg8tybm][/attachment:3sg8tybm]

    EDIT**

    [quote:3sg8tybm]Im kinda tired of this disability of C2. Title says "You can now make advanced games without writing a line of code." but it can't even load image for sprite as users want it to. It is obvious that if there is such feature people will want to use it as a way of loading DIFFERENT images for DIFFERENT sprites.

    Just noticed you said here Different Images for Different sprites. But in the image you posted you look like you are trying to loop through multiple instances of 1 sprite. My example is for loading the image for multiple instances of 1 sprite.

  • I changed a few things and according to the debug I added everything seems to be working as you want.

    [attachment=0:3kwkw490][/attachment:3kwkw490]

  • Glad you sorted it.

    I updated the capx but you beat me to it. I'll post the capx anyway for anyone else who wants to achieve the same thing.

    [attachment=0:d32wzg6w][/attachment:d32wzg6w]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You'll need to convert Layer Co-ords to Canvas Co-ords.

    [attachment=0:58c5xhrm][/attachment:58c5xhrm]

    I did it 2 ways.

    Instance variables for the drag-able box that covert the x pos & y pos on the layer to canvas and store them as instance vaviables. This was so you can see the expression more clearly.

    And a toggled disabled action that does it all in one expression but is a bit long and maybe hard to understand what's going on.

    The expression you need is under System>Layers>LayerToCanvasX & LayerToCanvasY.

  • You can use lerp()

    [attachment=0:cpmjdla1][/attachment:cpmjdla1]

  • Sorry I used the latest Beta version.

    Here is a version for 184 Stable.

    [attachment=0:3ae0xg97][/attachment:3ae0xg97]

  • I think this might be the control system you are after.

    [attachment=0:lauhq3h2][/attachment:lauhq3h2]

  • Now I'm starting to have fun a bit of basic Procedural Generation

    For 200 planets you still only need 1 sprite. You can use multiple frames & set a width dynamically.

    [attachment=0:lhypx6iw][/attachment:lhypx6iw]

    Planets can still overlap in the example but that can be sorted at a later date. The layout is 5000x5000.

    You say you'd need 200 predefined names which is true but wouldn't the same be true in C? I put a very basic 3 syllable name generator into the example, you'll get duplicate names & unpronounceable names but again that can be solved with a more robust (i.e not slapped together in a few minutes) name generator.

    There are is no planet information in the example because I don't know if we are now in the realms of ProcGen planets, predefined planets or somewhere in between.

    I hope we're getting somewhere slowly but I love this sort of stuff and have wanted to make something like this in the past.

    If you have any more info post it and we'll see where the example goes