dop2000's Forum Posts

  • This is possible with function maps, there is a template in C3 showing how to do it. However, I find using function maps really difficult.

    So a much easier option is to call functions by name from a script. (Note, that this will probably not work with advanced minification)

    First save function name in a local or global variable. Then execute this script:

    runtime.callFunction(localVars.FunctionName)

  • Are coal mine and oil pump members of the Minerals family?

    I think you need to change the last event on your screenshot like this:

    Button on clicked
    Block pick instance with UID SelectedLocationUID
    Minerals is overlapping Block
     Minerals destroy
     ...
    

    Also, it's not very efficient to re-create the buttons all the time. You can build the whole menu on the layout with hierarchy, and created/destroy it with a single action.

  • Beyondgodd This plugin doesn't care about collisions. You need to tell it which tiles are walkable and which are not. You can use a separate (invisible) tilemap just for this purpose.

  • There are several ways:

    1. Create an instance variable MineUID on the progress bar.

    2. Add progress bar to the mine as a child. (hirerarchy)

    3. Add progress bar and mine to a container, but then you'll have to make the bar invisible, you will not be able to destroy it.

  • It depends on the size of assets in your game.

  • I prefer tiled background, here is a demo:

    howtoconstructdemos.com/simple-healthbar

    I don't know your game, so not sure what will be the right way to pick Minerals instance. If only one mine can be built at a time and you only need one progress bar, you can pick by UID or custom ID variable.

    If you need a separate progress bar for multiple mines, you can link them with hierarchy, or put in a container, or use MineUID instance variable on the bar object.

  • In the second event on your screenshot (Every tick) you need to pick the correct Minerals instance. If you don't pick it, then the value of BuildStatus will be taken from the first existing instance.

    Also, don't use the ProgressBar object, there are too many problems with it. Make your own progress bar with a sprite or TiledBackground, simply set its width to (BuildStatus/MaxBuildStatus)*BarWidth

  • Make a solid border for it. Also make sure there are no other behaviors. Bullet should not fall down and stop, you probably added Physics to it or something like that.

  • You can use Bullet behavior with bounce off solids enabled. Also Fade behavior to automatically destroy it after 10 seconds.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you tried saving the project in C3 and re-opening it?

    The issue may be with just one sprite or behavior or effect. Try finding which one.

    Also try a different browser, maybe you'll get a different error message in console.

  • I would definitely use one sprite for all powerups. You can set powerup type with an instance variable, or use different animations, or animations frames.

    For example:

    Player on collision with PowerUp
     PowerUp is playing "Invincibility" animation : Player set isInvinvible=true
    
     PowerUp is playing "Health" animation : Player add 1 to HP
    
     etc.
    
    
  • Check out the documentation, there are a few expressions you can use when dealing with multitouch.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/touch

    Try setting the angle to:

    angle(Player.x, Player.y, Touch.XAt(1), Touch.YAt(1))

    where "1" is the index of the second touch (zero-based).

  • I suspect your entire event 93 runs on every tick. When boss3energy<=0, this event will repeat 60 times per second until the boss sprite is destroyed or layout is changed. This doesn't explain why it crashes the game, but it's still quite bad - running this event repeatedly will create lots of delayed "wait" threads, will play multiple overlapping sounds etc. You should make sure that this event runs only once.

    You can add "System Trigger Once" condition to this event, but only if you have just one instance of the boss sprite on the layout. Be very careful with this condition, it's very often used incorrectly and may cause very weird bugs.

    .

    You don't need to unload images when you switch layouts, the engine will do it for you.

    Using "Wait 20 seconds" is also a bad practice. This is a very long delay and you don't have control over it - you can't cancel or pause it. I suggest using Timer behavior instead.

  • If you can reproduce this with a small demo project, you need to log a bug report:

    github.com/Scirra/Construct-3-bugs/issues