Guizmus's Recent Forum Activity

  • If I'm not mistaking, you spare the timer and use the "On animation end" condition, from the sprite object, to revert to default animation too.

  • philx

    Glad it helped. Once you get a hang on how functions and UID work (and work well together), C2 becomes a lot more... fluent ?

    I didn't see your capx so it's hard to tell, but if I had to keep track of the dead player, a variable on the spawner, as you said, seems like a good way to go too. You may just have had a little bug in the events.

  • AJAX is, is C2 or not, restricted by some rules, to protect the user. One of those rules is : no cross-domain. This means an AJAX request can only be for the same domain your game is stored on.

    If it is required to pull some information from another website, you can do it from the server, in PHP using CURL for example.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let's call A = angle(center of the circle,mouse)

    Then you have the coordonates for your object with some trigonometry.

    X = cos(A)*D/2

    Y = sin(A)*D/2

    Where D is the diameter of the circle.

  • I can't take a look right now, I'll come back to it later.

    Using a container is usefull because :

    • if you pick an enemy in an event, you'll pick also the pixel, and the opposite way too
    • if you destroy / spawn one, the other will do the same. (you will have to have an event that, on enemy spawn, pins the enemy to the pixel though)

    Containers just says that one cannot exist without the other.

  • If you have access to families and use the solution I sent (only with 2 players, not hard to expand to 4), timer shouldn't be a problem.

    No you can't "observe" the change of a value. Instead, you can do a function "changeValue", that changes the value and calls another function if the value is now 0. Then, just always call this "changeValue" function instead of changing directly the value.

  • Could you share the .capx so we could take a look ? I'm not sure to understand right...

  • Nice if it helped :) And for the first solution, don't bother, I see you don't have the full edition for now so you don't have families anyway...

  • Well, the problem is the rotation and movement direction.

    One thing you could do is use another object for each enemy.

    This object would be a single invisible pixel. You would want to put this pixel in the same Container as the enemy, so each enemy has a pixel linked to him, and when an enemy is picked, the pixel is also picked.

    Then, you would have to have the pixel handling the pathfinding, and rotating, instead of the enemy. The enemy would only be pined to the pixel, without rotation. You still handle the rotation of the enemy sprite manually as you do right now. You will also have to transfer the movement function to the pixel, as he is now the one moving.

    So now that the pixel moves and not the enemy, if you have the line of sight on the pixel object, it will follow the rotation.

    After re-reading what I wrote, I may completly miss your problem, if I misunderstood how you handle the enemy rotation on screen. If that is the case, sharing your capx could help.

  • You could put all those "clickable" objects in a family, and have something like

    On click on Clickable

    OR

    On touch on Clickable

        Then call Function("Click",Clickable.UID).

    Now, every time you have an event that was triggered by an "onclick" on an object X, replace it by :

    On function "click"

    X->Pick by UID (Function.Param(0))

    (Other conditions, like If enabled collisions, ...)

    You will this way have the "OR" you needed, but you will keep a "AND" context everywhere you need.

    EDIT : I might be mistaking, but I think a "on touch" triggers a "on left click" also, meaning you would just have to change all the on click with on touch. To be verified though

  • You should take a look to this thread : scirra.com/forum/request-steam-plugin_topic79133.html

  • Or just some little sprite, spawned 8 times in a row with random angle, a bullet behavior, and a fade out with destruction on end on fade.

    This seems more usable for what you need (you could have multiple stars animations, selected randomly on spawn, ...), but I don't know what is best, performances wise.

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies