DiegoM's Forum Posts

  • You can do this using the System expression unixtime to get the current time in milliseconds. Then you need to use a little JS script to get the time in milliseconds of the target date.

    With those two numbers you can calculate the difference between them, and from the result extract all the different parts of the countdown timer.

    This is a little bit more complex than it seems, so I made a little project. Hopefully this will be useful to others aswell.

    https://www.dropbox.com/s/ro5sukq3sytb42x/New%20project%20%284%29.c3p?dl=0

    The project calculates the time remaining until the 1st of January of 2021, but can be adjusted to count down to other dates as well.

  • You saved the project as a folder, so you need to go to Menu -> Project -> Open -> Open local project folder and then select the whole folder than contains your project.

    When you save this way, a .c3p file is not created.

  • For this kind of logic you need to be very specific for it to work as expected. That means checking for the state of ALL the options.

    So if the set of answers is [A, B, C, D and E] and the correct set is [A, B], what you need to check for is A = true and B = true and C = false and D = false and E = false.

    In that case, your answer is correct, in any other case it is wrong.

    If you don't do it that way, you will get unexpected results, as you have experienced already. This is because if you only check for A = true and B = true, the code is not taking into account any of the other options, as long as those two conditions are met, the answer is correct.

  • Don't worry about a test project, sorted out the issue. The fix will be available in the next beta release.

  • Try saving the position of the axe when the tree's life reaches 0. Save it in an instance variable in the tree object. Then use that position to check to which side the tree should fall. It won't change again, so the tree will continue to fall to the same side.

  • I am seeing a similar issue, but not quite as you are describing. The Sprite Font doesn't preview opacity properly in the editor, but at runtime it works fine.

    Can you share a project reproducing the issue?

  • I was going to suggest using keyframe tags, but after trying this out for myself, I think you might have uncovered a bug.

    It seems like if you are able to pause a timeline right at the moment it begins (time = 0) or ends (time = max), something which is doable using keyframe tags, Construct assumes the timeline should be destroyed.

    I'll have this fixed for the next beta release. Thanks for bringing it up!

  • There seems to be a difference in how events are handled when you preview them directly and when you transition between them, need to investigate that further.

    That difference is causing your first attempt with a not playing condition to fail, because while it works when you preview the layout directly, as you would expect, because the Play action comes before the check... when you enter from another layout the condition is hit once, before the timeline starts playing, starting the whole process to exit the layout before the timeline is finished.

    Your second attempt, avoids that problem by using the On Finished condition, but the fade to black transition does not work, because the trigger is only hit once, so updating the opacity based on a delta, doesn't work.

    In order for that to work, you would need to set a flag on the On Finished trigger, and then based on that flag decide when to start playing your fade to black animation, elsewhere in the event sheet.

    You could also add the instance that is the black background to Layout 2, set it to opacity 0% in the editor, and animate it in the same timeline you are using to move the cat. Below an example file showing that method. The good thing is you can get rid of some of the events, as the timeline takes care of everything regarding the animation.

    https://www.dropbox.com/s/g714jdw9z3iwzg2/FrankieGame2.zip?dl=0

    Your game reminds me of an old DOS game, Alley Cat https://www.youtube.com/watch?v=uZDG4dlU5uY

  • I'll take a look on this to see what is going on.

  • Looking at this now, sorry about the delay, I was hanged up with a few other things!

  • Can you share your project? That is the best for us to be able to figure out what is going on.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sprite, Tiled Background, Tilemaps and even Drawing Canvas, can be thought as only graphical representations for the objects in a game. So it really doesn't matter how you are using them as long as they draw what you want where you need it.

    The names might imply they are meant for certain tasks only, but if they work for a particular need, it should be just fine to use what ever you feel like. Of course if you need frame by frame animations, I highly recommended you use the Sprite plugin over some other dubious method.

  • Hmmm... that looks quite messy indeed.

    Thanks for the feedback, I'll look into something to remove the clutter if it is not needed.

    Do you have any ideas in mind?

  • 619_RM

    I think the problem is in your condition to check for the player's health.

    Currently the check is PlayerLife = 0.

    This works fine for one collision at a time, because they are set to Subtract 100 from PlayerLife and the initial life is Set PlayerLife to 100, so after a single collision, the health value will sit right at 0 and the condition will be met. If more than one collision takes place in the same tick it will stop working because the player's health will go bellow 0 before it is checked again.

    So I think your problem will be solved if you check for PlayerLife <= 0 (less or equal). That way no matter how much bellow 0 the health goes, the condition will still be met.

  • Have you tried using this browser API https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope

    It grants Javascript access to the gyroscope of the device, assuming there is one.

    I am guessing you could write a little script that used those values to feed a number into the system action Set Layout Angle.

    Haven't tried any of this myself, so it might not work, but I think it's worth a try.