Nic_MDS's Forum Posts

  • I think there's no problem happening. You are unfocusing from one browser to another, and when that happens the game freezes.

    If you play in two focused browsers using different PCs or Smartphones it will probably look as intended. :)

  • I got it guys, thank you! I did like newt said and made a simple first screen that asks the user to touch or click the screen before starting anything else.

    But I'm still curious about why all the audios that had to be played while the user didn't touch the screen play at once. It happens on Chrome. Not like it's a big deal, just a curiosity!

    Again, thank you all for your answers. =)

    EDIT: I just got to read the page Ashley recommended and got it. Thank you!

  • Even the problem with the audios playing all at once? Thanks for the answer.

  • Hey community! Hope you all are doing well.

    I'm in a project where the game runs itself with not so much input from the user, sometimes there's no input from them at all.

    It runs on Browsers. The catch is, when the user starts the game, if he doesn't click or touch the game, it doesn't play the audios. And when the player touches it, all the audios that had to have been played plays at the same time in one shot! And after that, it goes all well.

    Is there any way to make the game start focused when we open the link? Not requiring the player to click or touch the screen in order to do that?

    Thanks a lot for anyone that can help!

    Tagged:

  • On the action where you play the Background Music, put the optional tag on it (it can be anything you want).

    Then, right before where you play your Death Jingle, put the action "Stop" from the Audio Object.

    Inside this action there's an option where you can "aim" it at a tag. Write the you chose in the "Play Background Music" action.

  • [DOUBLE POST, sorry]

    Well, I didn't figured out how to access the data from the iFrame... But I did a workaround without using the iFrame Object.

    For anyone interested (sorry if I get any terms wrongly, I use Construct in portuguese):

    -----

    -Using AJAX, BinaryData and Video game objects.

    -On Start of Layout, set AJAX binary response to BinaryData Game Object.

    -Still on Start of Layout, request via AJAX the URL "https://link.com/video.mp4" with the tag "videotest" or anything else.

    -AJAX On "videotest" completed, set Video source (H.264) to BinaryData.GetURL. Don't know if it works using WebM or Ogg Theora, but it probably does)

    -----

    This will make the video play after the time it takes to download (you can see if it's downloading using the Video On Progress event).

    Doing this way I can use On Video Ended to trigger the action to change the Layout.

    See y'all!

  • Hey guys! In my project I have an layout that plays an mp4 video from a iFrame.

    I need to check when the video ends playing so I can move the game forward to the next layout.

    I can not make any alterations server-side...

    Does anyone know how could I access the time in seconds of the video being played from the iFrame? It would be awesome! I've been searching a lot, but didn't found anything.

    Thank you!!

    Tagged:

  • You may be able to use LocalStorage.

    When the Layout starts, verify the existence of an item called "tutorialFlag".

    Then create an event called "When item exists" (or something like that, I use Construct in other language). If it exists, deactivate the tutorial, destroy it or what you prefer.

    To end it, once the player finishes your tutorial, simply create an action of the LocalStorage called "Define Item" with the name "tutorialFlag" and set it to 1. You could even create an event called "On Item Defined" to show some visual cue indicating some kind of save state, like a little green thumbs up that appears for 3 seconds and then disappears.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey man. One way would be to local store the last time your game has been played, maybe doing some verifications from time to time when it is being played.

    When your player opens your game again, compare the actual time with the last time it has been played (stored in local storage) and update your health bar accordingly.

    This is not a very good approach. It may lead the players to cheat in your game. A good way would be to do it using an external web server to better protect the data. Basically doing the same thing, but verifying and storing time values from and on the server.

    Also, I just found a topic here in the forum called "HOW DO I COMPARE TIME BETWEEN GAME SESSIONS ?". The guy have a google drive link with an example about it.

    https://www.construct.net/en/forum/construct-3/how-do-i-8/how-do-i-compare-time-between-141171?kws=elapsed%2btime

  • Hi!

    Thanks for helping!

    Luckily I got it to work quite simply in the end, I just used a "system" --> "wait for previous actions to complete" action after starting the timeline and then I destroyed the instance, all in the same event block.

    Good idea! =D

  • Hey man. Maybe you could create a variable inside the object called something like "endReached". In the timeline, use or create a masterkey near the end (not exactly in the end) of the animation tagged as "end".

    In the Event Sheet, using the "master key frame reached" event (don't remember if that's the name, I use it in other language), put the "end" tag in the available option.

    As an action, set the endReached variable to 1.

    Then create a last event/action "if endReached == 1, destroy gameObject".

    Don't know if it could work, but it's an idea. Good luck!