dop2000's Forum Posts

  • Just add System->Set Group "Buttons" Inactive to all events where you make that layer invisible.

    And add System->Set Group "Buttons" Active to the event where your character dies.

    By the way, you shouldn't have Mouse-Clicked and Touch-Is touching as two conditions of the same event. On a touch device it will never work. Even if you change it to "Or" block, it will still be bad, as "Is touching" condition is continuous and triggers every tick while the finger is touching the screen.

    I would move the code into a function "RestartGame" and create two different events, one Mouse-Object Clicked, and another Touch->Object touched, both calling that function.

  • Have you tried Pin behavior?

    Pin Body0 to Head (bar or rope style), Body1 to Body0 etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, sorry, then you should check if the layer is visible, not the button.

    But as I said, it's better to disable the entire group of events.

  • Do what?

  • You can simply add another condition to your click event:

    Mouse -> Clicked on MenuButton

    (and) MenuButton Is Visible

    Or a better solution would be putting all menu events into a separate group "Menu Events" and disabling this group when it's not needed.

  • If it starts and not ticking down, then blackhornet is probably right - your timer is restarting again and again every tick.

    You can add some debug output (for example Browser->Log "timer start") to check if this really is the case.

    You need to update conditions in this event to make it trigger just once.

  • redfoc

    R0j0 recently uploaded a great demo in this post:

  • I think I used only the first one.

    But you can install CSV2Array and CSV2Dictionary as well.

  • I'm using this CSV plugin:

    plugin-csv-csv2array-csv2dictionary_t64326

    I don't know what kind of game you are creating, so it's hard to give you any advice.

    Here is a little example I made for another post:

    https://www.dropbox.com/s/0ex32akdcl7s2 ... .capx?dl=0

    You'll need to install the CSV plugin to run it.

    In this demo there are 2 levels using the same layout. Levels have different items offered in the shop, these items are loaded from the CSV file.

  • Keep "Set angle=Yes" in Bullet properties and replace "Enemybullet Set Bullet angle of motion..." with this:

    Enemybullet -> Set Angle to (self.Angle+random(-15,15))

    So when a bullet is spawned, its angle is initially the same as enemy's angle. Then you adjust it by random number of degrees. And then it will fly in that direction because of "Set angle=Yes" setting.

  • koops

    You can try this behavior:

    You'll need to install it (put into \Construct 2\exporters\html5\behaviors folder)

  • Object - your coin.

    Layer - layer where you want the coin to appear.

    Image point - image point of Enemy object. "0" would be its origin image point.

    It's a common method of spawning and it should work.

    Try running your game in Debug Mode (Ctrl-F4), you'll be able to see what's going on. You'll see if the number of coins increases after an enemy is destroyed, where on the layout each coin is located etc.

  • Have you tried this?

    Enemy-> On destroyed

    ............Enemy -> Spawn Coin

  • The more I learn C2, the less often I use arrays

    Surprisingly, in many situations where you would normally use an array, C2 allows you to do the same easier without them.

    For example, let's assume that your tiles are sprites. You can add a couple of instance variables to the tile sprite, like "occupied" or "objectType" and do something like this:

    Repeat 5 times:

    Pick an empty tile, spawn Neutral sprite on it, mark the tile as occupied, set objectType=neutral.

    Repeat 3 times:

    Pick an empty tile, spawn Enemy sprite on it, mark the tile as occupied, set objectType=enemy.

    Repeat 1 times:

    Pick an empty tile, spawn Friendly sprite on it, mark the tile as occupied, set objectType=friendly.

    And now you have your "array" in a form of 9 Tile instances. You can add more instance variables to Tile sprite and store lots of data for each tile. You can pick/filter tiles using various events, loop through tiles in any order etc.