Minor's Forum Posts

  • Without a definite idea of what you are trying to achieve all we can do is just keep trying to gently poke you in the right direction.

    For example if you have a set number of planets (i.e always 10 & always the same planets) you can fill in all the instance variables in the layout editor. Then you could randomize the X&Y at the start of layout.

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

    In the example the planets can overlap but it's just to show you that you could randomize X&Y even with planets predefined in the layout editor.

    If you're going to have random numbers of planets (possibly moons) then there are multiple ways of storing their data and populating the random planets at runtime. You could randomize them completely or randomly choose a planet from a list of predefined planets.

    If that's where you're heading then just post here and I'm sure you'll find the help you need.

  • In the layout editor.

    Click any of the planets in the layout editor and on left you'll see the "Instance Variable" panel you can edit them there on a per planet basis. You could of course add them with events especially if you wanted to randomise the values.

    Hope that helps.

  • Cybergod

    Instance variables although unique to each instance of the same object can be accessed and passed to global variables & to other objects.

    I threw together a little example of setting global variables to the instance variables of a clicked planet. Planets are invisible until the mouse is a certain distance away.

    Hope it helps with instance variables.

    [attachment=0:19wbzezk][/attachment:19wbzezk]

  • Here's a very rough version of using lerp to zoom.

    [attachment=0:fnjln7gl][/attachment:fnjln7gl]

    But like Coin-coin le Canapin try out Magicam it's an awesome plugin.

  • It doesn't work as you expect it in your game because what I gave you is just a small example of what you wanted it's up to you to properly integrate it into your game.

    In a couple of minutes I made it unbreakable and so it restarts properly.

    [attachment=0:11otinxw][/attachment:11otinxw]

    Sorry if I sound harsh at the top it's not meant to be but no one can make an example that works perfectly for a game when they have no idea how it works.

    Hope the new version helps

  • I take it this is for your shooting game?

    Easiest way is create a variable global or instance and call it "canclick". Then on your mouseclick for shooting add the condition "canclick=0". When it's game over or score>100 set canclick to 1. That way you can no longer shoot because "canclick" is now 1.

    [attachment=0:60dphlpg][/attachment:60dphlpg]

  • saf

    Here is the object placement. I had to change some stuff around from the last example I made and would probably do it slightly differently but might give you a start.

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

    I tried this yesterday and forgot to post it.

    jimwills

    I'll have another play with your problem later see if I can narrow the problem down

  • Here's an example for you.

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

  • This is a working version of your .capx.

    I added an image point named "erase" and used that to test for tiles.

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

    Your version didn't work because you used the sprites X&Y which are in the centre and there will never be a tile at that position to check against.

  • You'll need to use the RIGHT expression under "System Expressions - Text

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

  • The wonderful rexrainbow has made a plugin to load levels created in tiled.

    https://www.scirra.com/forum/plugin-rex-tmx-importer-v2_t103854?&hilit=tiled

    Never used it myself but as long as you know which tiles in Tiled should use the 2nd tilemap it should just be a case of looping through the Tiled export file using the plugin and placing the correct tiles from the correct tilemap.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I'm done with this at the moment.

    It just seems too counter productive to try and code around 1 tilemap it's almost like redoing C2's excellent built in Platform behaviour in events. It would probably work better if I used a state machine & imagepoints. I probably could get it to work better but like I said it's like re-inventing the wheel.

    Here's were I got to:

      Conveyor left & right Spring Jump thru and drop through platform (sign in tilemap) Ladder (only up -

      Biggest bug is move off the ladder then back on while falling and you'll go through the solid floor

      )

    [attachment=0:3409nimm][/attachment:3409nimm]

    I would definitely go with multiple tilemaps it would be much easier.

  • I think multiple tilemaps is the way to go.

    I carried on with my last example I made and did get "jump thru" sort of working with 1 tilemap but it really isn't worth the extra events to make it work. Don't know how you are building the levels whether inside C2 or Tiled but either should be easy to do with 2 or more tilemaps.

    **EDIT

    Playing around some more I'm starting to get better results with just 1 tilemap. I'll post the capx when I'm happy everything is working as it should.

  • Not exactly sure what you are asking but

    loopindex("j")

    &

    loopindex("i")

    will return the current value of

    i

    &

    j

    inside the loop.

  • I carried on messing with my example and added very basic platform logic to the tile checking.

    Added a spring - Up arrow on tilemap

    Added conveyor left & right - left & right arrow on tilemap (this needs a bit more thought to it to make it work correctly i.e you stop before falling off the edge due to tile checks)

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