ome6a1717's Forum Posts

  • I'm running into gameplay mechanics that require me to design my own collision events - mainly when you hit an enemy and he gets knocked back, regardless of the collision set for the object, the enemy will be knocked INTO the object if the collision box is big enough.

    What is the best way to fix the code for something like this? I've tried setting "if enemy is overlapping bigcollisionobject, when knocked back 100 pixels, move 100 pixels in the opposite direction". But it doesn't happen instantaneously, and looks very noticeable.

    Does anyone have any solutions or ideas for this?

    Thanks!

  • You guys are amazing - thank you!

  • I'm trying to use it like this:

    On Sprite1 Destroyed

    For Each Sprite1

    Pick Sprite2 Instance with UID "Sprite2.Pin.PinUID"

    -Destroy Sprite2

    It doesn't seem to be working. What am I doing wrong?

  • During the course of my game, I will have plenty of sprites being spawned on top of other sprites (ie. if you set an enemy on fire, spawn fire sprite. if an enemy detects you, spawn ! sprite). Normally when I destroy a sprite, I can use a "On Sprite1 destroyed - if sprite1 is overlapping sprite2, destroy sprite2" and it works. But what do I do if sometimes multiple instances of Sprite1 will be overlapping each other (which is always a random occurrence)?

    All of the sprites I spawn are pinned 99% of the time. Is there an event to check if an item is pinned to another object? (if I use Sprite2 is Pinned, it destroys ALL of them in the layout)

  • Ah perfect - thank you :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quick question - is there a way to use the distance expression with ONLY x or y?

    ie. If (distance(Sprite1.X, Sprite2.X) < 300 and If (distance(Sprite1.Y, Sprite2.Y < 900)

    Thanks

    Steve

  • Hmmm...when I do that, if there are 2 badguys on screen, one of them spams the Startle sprite even more. I tried adding a "BadGuy is on-screen" event, but that didn't seem to do anything.

  • This is the code I'm currently using.

    <img src="http://stevemazzaro.com/triggeronce.png" border="0" />

    The code works perfectly until you get to the final enemy instance on the layout. The last enemy starts spamming the Startle sprite every time you hit it with your sword.

    The sword collision event sets the EnemyAlert to 1 and includes all of the EnemyLOS actions you see above, but why would it work for all the other bad guys, and not the last one?

  • Perfect - thanks for all the responses. I ended up using RamPack's. I tried disabling the group, but for some reason it still didn't seem to work.

  • Fantastic - thanks guys!

  • Simple question - does STEAM accept C2-made games for their greenlight program?

  • Hey RamBam,

    Thanks a lot for looking into this. I don't use the beta version of construct, so I can't open your file. If you wouldn't mind, could you post an image of the code?

    Thanks!

    Steve

  • It's been done.

  • ome6a1717

    You only want the mana timer to start if mana is less than maximum, correct?

    If mana < manamaximum, subtract 1 from mana timer

    When mana timer reaches 0, add 1 to mana, set mana timer back to 4

    Event Conditions: 1) Every X Seconds, 2) Mana < Manamaximum

    Actions: subtract 1 from mana timer

    -- Sub-Event: Mana timer <= 0

    -- Actions: add 1 to mana, reset mana timer

    I hope that's clear. :) Sometimes explaining isn't as easy as doing. If you're still having trouble, I can do up a quick capx for you.

    Hey Space,

    This is exactly what I did, and it's entirely possible with my somewhat limited knowledge of C2 I AM, in fact, doing it wrong.

    However, when I do this code and set a text box as the mana timer (just to see the effect), when Mana < Manamaximum, the timer goes straight to 3 instead of waiting a second (will sometimes wait half a second, or 1 tick, etc. - depends on when mana < manamximum because the every X seconds is running no matter what).

    Hopefully I'm explaining this right?

  • Let's say , manamaximun = 5 and mana is a variable

    ...

    Every 4 seconds

    -- if mana < 5

    ---- Add 1 to mana

    Hmm...I tried this and it still doesn't work. It seems to run every 4 seconds no matter how you put it. Is there any other way to do this?