Minor's Forum Posts

  • It makes it much easier if you are tracking your tiles using an array.

    Here is a nicer example of "Bitwise Numbers" to automatically tile what you draw for you.

    HTML5 Demo

    Just left click to place a tile. Ignore the tilemap it was something I had laying around from an old prototype just imagine the sea/blue is the grass and the sand is your dirt.

    Here is more info on Bitwise Numbers definitely worth reading it's a great explanation of bitwise numbers.

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

  • If you change the action from "On released" to "Button down" in the example it works like the laser follows the mouse.

  • I would make this much simpler and just used time passed as the distance. Why go to the trouble of counting pixels and working out distances when every x seconds you travel 1 meter.

    I'm guessing that's how Jetpack Joyride works why make things more complicated than they need to be.

  • Something like this?

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

  • [attachment=0:19oqteyf][/attachment:19oqteyf]

    Added a 2nd layout that loads the saved json into a separate array. You can press "S" in the first layout to save as json.

    Works fine for me this way and copying and pasting the json string into a global variable works too but I disabled that action. Below is the level from the text file I created in the first example exported to json.

    [quote:19oqteyf]

    {"c2array":true,"size":[10,10,1],"data":[[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]],[[0],[1],[1],[5],[1],[5],[8],[5],[1],[0]],[[0],[2],[5],[6],[2],[6],[5],[4],[5],[0]],[[0],[4],[5],[5],[4],[5],[4],[5],[4],[0]],[[0],[1],[4],[3],[4],[9],[8],[2],[8],[0]],[[0],[2],[8],[2],[5],[5],[5],[6],[5],[0]],[[0],[2],[2],[2],[8],[6],[6],[9],[2],[0]],[[0],[3],[2],[6],[6],[5],[2],[5],[3],[0]],[[0],[2],[1],[6],[5],[6],[2],[5],[2],[0]],[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]]]}

  • [attachment=0:48oco6dr][/attachment:48oco6dr]

    This fixes the problem by removing the unneeded bullet behaviour actions for a simple wall slide.

    I've not seen that example for a wall slide before. In my opinion it seems to me to be overly complicated when the platform behaviour has all the actions to do this without the need for another behaviour to be used.

    Also under platform actions for the player you can use "set ignoring input" to true to stop the player being able to move.

  • Glad it was of some help.

    Just a quick note for everyone that the example only works with single digits to represent a tile.

    [quote:3tvhbgnr]@Minor yes, you made exactly what i wanted to do! many thanks! i used the array z axis for storing multiple levels and downloaded the resulting array json data which i now can use in my game!

    More people should do that type of thing. It's something I very often do, hack together a level editor or a way of adding stats for guns or RPG character stats and export it via Construct to json. You know for sure then if Construct exported it, it's going to load it correctly.

  • Here's a rather quickly and badly hacked together way of doing this using

    no

    external plugins.

    [attachment=0:17bvfyp7][/attachment:17bvfyp7]

    The level is structured as below in the text file, I'm guessing it's the type of thing you are using.

    0000000000

    0124122320

    0155482210

    0565322660

    0124458650

    0565956560

    0854856220

    0545269550

    0154852320

    0000000000

    Like I said there is probably an easier/elegant way of doing it

    (probably using REGEX actions)

    . But for a first attempt and in 15mins I think it came out pretty good.

    Hope it helps.

  • Here's a very basic example.

    [attachment=0:10wtmj0e][/attachment:10wtmj0e]

  • Yes it will only connect a road piece to a piece that is already placed correctly.

    You'll have to work on placement a bit as it will place a piece where it was dropped so technically you could drop each piece on top of each other. Personally I would do like you did with the startx & starty variable and hard code the correct position to 2 variables and snap there when dropped.

  • You'll need to use families for this way to work properly. Here's a quickly hacked together edit to your .capx think it works as you want I haven't fully tested.

    I've added the needed instance variables to the family variables so you can check the states correctly.

    [attachment=0:yj8pzblw][/attachment:yj8pzblw]

  • Maybe my tutorial/example will help.

    Drag & drop Correct Place

    Personally I wouldn't use different sprites as each road. Use animation frames for the roads as you have done but use a copy for detecting if it's in the right place.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a quick example of how you could use Rojo's canvas plugin to show the static minimap. I think I've got the same dimensions as you mentioned in the post.

    [attachment=0:20ee21iw][/attachment:20ee21iw]

    And the plugin is

    HERE

  • Here is a fixed version for you.

    [attachment=0:izo2gwhh][/attachment:izo2gwhh]

    Updated CAPX - Changed something that didn't need to change so put it back how you had it.

    Also quick explanation why yours didn't work. You were checking if the "crosshair" wasn't overlapping "enemy" but if you are aiming at any other enemy you are "overlapping" an enemy so that event wouldn't be true.

  • Here is an example that I created for another user.

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