eli0s's Recent Forum Activity

  • You want something like this?

    http://eli0s.com/Tests/Zombies.capx

  • For the first part you could try comparing the critical ability of the player and the enemy with the "system compare 2 values" and then add the following to the damage value: choose(0,0,0,normalDamage*2).

    The logic behind it is that you are already subtracting a normal damage value on every strike, so when the critical hit condition is met, add to the normal value some extra damage (normalDamage*2), but do it by chance of 4 to 1. The choose expression will do exactly that, every time it will choose between the values within the parenthesis, in our case we have (0, 0, 0, Xdamage) so, 25% chance of getting extra damage.

    For the second part, I am not sure what you mean, but perhaps you want a short period of invulnerability for the enemy between each time he gets hit? If yes, you could either add an "is animation "enemyHit" NOT playing" condition (invert the is playing by right click on the condition and choose invert), or add a Boolean instance variable (e.g. "hit") to the enemy and a timer behavior, and each time the enemy is hit (add a condition to check if he can be hit using the Boolean), set the Boolean to "true" and start a timer countdown. On the countdown end, restore the Boolean to false, so the enemy can be vulnerable again.

  • If you are still interested, you could also use an opaque layer to change to the night time. The fade-in logic however is the same as with a sprite:

    http://www.eli0s.com/Tests/NightTime.capx

  • Hmmm... It's more complicated than I expected. I like what you already have set up. I can't figure out how to make the instances behave separately with an Instance Variable and the "For Each" loop gives me an error at run time.

    The only thing I am confident that it will work is to use different objects for each enemy, but this isn't very practical if you have a lot of enemies. Actually, it's rather dumb...

    Perhaps an advanced forum member can help here..?

    I am sorry for not being able to help

  • This is the best I can do. It works, but there must be a more elegant way to do it.

    http://eli0s.com/Tests/EnemyHealthBars.capx

  • Make sure that the lifebar object exists on a layer with its parallax values set to 0,0! You can get access to a layer's properties by clicking on a layer and then look at the properties panel.

    All objects within a layer with 0,0 parallax values will not be affected by the scrolling. They will remain at their initial position on the screen, something that is ideal for HUDs.

  • I am not sure if families are available on the free version of Construct 2.

    Anyhow, I guess you are using instances of the same object and that is why they behave the same. You can either:

    1) Create a separate entity (clone object type) so that they'll be totally independent from each-other

    2) Create an Instance Variable (perhaps a text so to give your enemies names) and in the event sheet create conditions that check (compare) the Instance Variable (name) and add actions accordingly for each enemy.

  • Beaten at the finish line

    But the "trigger once while true" should be also valid.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe what you see is the result of new sprites being created every tick on top of each other and playing the animation with a phase difference of one tick (so you see all the frames overlaying).

    You can confirm that easily with the debugger, just see the number of objects, it should increase rapidly over time.

    This is happening because when the condition '"is Group "mole1" active" becomes true, it stays true, thus performing the same actions over and over again.

    Add a "system | Trigger once while true" condition below the "is Group "mole1" active" condition, to make sure that you create only one "Mole9" object.

  • Perhaps with an instance variable, a Boolean ("Collected") set to false..? The ones that weren't collected and still have the Boolean set to false, could be checked upon start of layout and set hidden/invisible.

  • Since you spawn the enemies at run time, obviously you can't see them on the editor. Perhaps if you assign an Instance Variable on the object(s) that you use to spawn the enemies, and use the variable to define which instance spawns what enemy, then you could have a better sense of the spawn objects and their role in creating enemies.

  • The Set Position should suffice for the first layout. I think that the anchor behavior was messing around with the position. You don't really need it, I think it's useful in circumstances like when the browser window change in size and you want the objects to dynamically adjust within the screen. Since you are interested in 0,0 coordinates, these do not change no matter what, so if you set the position once per layout you are ok!

eli0s's avatar

eli0s

Member since 24 Apr, 2013

None one is following eli0s yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers

Progress

13/44
How to earn trophies