dop2000's Forum Posts

  • Push on X axis sets the same value to all elements on Y axis.

    So if you need to add "20,apple,red" you can do this:

    Array Push 20 on X axis
    Array Set "apple" at X:(array.width-1), Y:1
    Array Set "red" at X:(array.width-1), Y:2
    
  • The most common mistake is using it with multiple instances. For example "if Enemy health=0, Trigger once : Enemy set animation DEAD". This looks good, but it will not work with multiple enemies. Also, people often put this condition inside triggered events, loops, which can produce some weird results.

  • I don't like "Trigger once", it can cause many problems when used incorrectly.

    Make sure to only save items to local storage when needed - i.e. after finishing a level, when settings has changed etc.

  • You are setting item "Muted" on every tick and probably other items too ("LevelReached", "LevelArray" etc.) Reading from and writing to local storage on every tick is a serious mistake, don't do this!

    Also, you have "On item set" events nested under other events, which may cause them to never trigger. They need to be top-level events.

    Take a look at this demo, showing an efficient way to use local storage, you can open it in trial version of C3.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why do you need two events and EndTurn variable? Why don't you increase Turn and create a new instance in the first event (Every 1 second)?

  • I don't understand your question. You need to post a project demonstrating the problem and things you've already tried.

    Also, please don't tag me or other people.

  • In your last screenshot Turn variable will only increase for one instance, that has been created.

    See examples in my previous comment.

  • What family do you spawn? The same "TilesObj.." family?

    When you create a new instance (object or family, doesn't matter), this instance is automatically picked in this event. So all other actions in the same event will affect only one newly created instance.

    However, on your screenshot you are creating PotionObj object. But then you are changing the variable for TilesObj family, which is not picked, so the variable is changed for all existing family instances on the layout..

    Example:

  • Boolean is true => spawn coin, add 1 to family 1 var, set boolean to false.

    Boolean is true => spawn family 1, add 1 to family 1 var, set boolean to false.

    Both of these events should be the exact same.

    No, in the first case the variable will be increased for all family instances, not the one that you've just created.

    .

    If you are creating a new "Coin" instance, you need to use "Coin" in other actions in the same event.

    If you are creating a new "Family" instance, you need to use "Family" in other actions in the same event.

  • Yes, it can be done much easier. Remove the camera sprite and change your events like this:

  • it copies instead of a transparent background to white.

    This problem existed in C3 since day one. The only option is to save as png.

  • I have an old demo that is similar to what you want. It's not perfect, but you can probably adapt it for your game.

    howtoconstructdemos.com/top-down-view-shooter-collect-swap-and-fire-different-weapons

  • If you can have multiple instances of each enemy type, then you need to link health bars to enemies by their UID. Add all enemies to a family "Enemies". Add enemyUID variable to the health bar sprite.

    Enemies on Created 
    	-> Enemies spawn HealthBar
    	-> HealthBar pin to Enemies
    	-> HealthBar set enemyUID variable to Enemies.UID
    
    
    Enemies on collision with Bullet
     -> Enemies subtract 1 from health
    	
     	HealthBar compare variable enemyUID=Enemies.UID
    	 -> (update health bar)
    
    

    .

    Another option is to create a separate health bar object for each enemy type in your game. Then you can simply add each health bar into a container with each enemy, and they will be linked automatically, no need for instance variables.

  • Usually for HUD/UI layer you need to set scale rate and parallax to 0%. Everything else will be scrolling and scaling, except your UI elements.

    It looks like you have scroll at (0,0), try setting scroll to (427,240)

  • Your link doesn't work. If you are setting one item, try using "On item set" event.