BigBuckBunny's Forum Posts

  • The way you save the recording looks good. If you want to play that data back, one way to do that is to get the data from the BinaryData object in Base64 format using BinaryData.GetBase64. Assign the data in that format to a string local variable (i'll call it Base64String).

    Now you have to use the Add Remote URL action (Audio) to add the recording so that you can play it. Since the URL you pass to the action itself will be applied to the src field of the html audio element, you can pass as URL "data:audio/mp3;base64,"&Base64String and leave the other parameters unchanged (except for the name) to be able to play your sound by name.

    I tried this solution and it works fine, even though there may be more efficient ways to do the same thing. Give it a try :)

  • Right click the family folder in the project bar and select add family. Note that objects of a family must be of the same type (ex: you cannot have sprite and text in the same family). For more information check the manual: https://www.construct.net/en/make-games/manuals/construct-3/project-primitives/objects/families

  • If you want to delete all enemies in between the UP arrow and the DOWN arrow (included) you must filter the enemies of the same column that have Y <= UParrow.Y and Y >= DOWNarrow.Y.

    When you detect a UP arrow enemy that touches the ground, you should call a function that does that for you. That function should pick the enemies in between and delete them.

    Here's a working prototype:

    c3p: dropbox.com/scl/fi/86x19cm0ap8p609a4osns/EnemiesInBetweenPrototype.c3p

  • Your project lacks a lot of organization, that's sure. I tried taking a look, but changing something seems to generate other bugs, which is often a sign of a deeper issue.

    Here your main problem is that you are checking conditions at every tick. When you have a condition in the event sheet without a green arrow next to it, that condition is checked every tick. That means that, if the condition is met, the associated actions keep running as long as the condition is met. In your case that's a problem. You can use a condition called "Trigger Once" that changes the behavior of the attached conditions by firing the actions only the first time the conditions are met.

    Try the code in the image.

    Also, note that on line 111 you have On "Players Array" completed -> set player text. Removing that line seems to solve the issue of the text changing briefly before the players appear.

    I see that you don't use families, actions, functions and much more. There are a lot of things in Construct which can help you avoid unnecessary work (notice that most of your events repeat things over and over). I made a small example of a basic prototype of your app (only virus) that uses these things.

    dropbox.com/scl/fi/nkytxmktzjv6g5q6xvjnm/DemoImproved-1.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends on the type of game you're making. If you're developing a platformer using the Platformer behavior, then you can use Platform has wall to right/left and Platform is on floor to check for bottom and side collision. To check for collisions with ceiling, simply test the overlap at ofset using Object is overlapping at offset 0 -5.

    If you are making a top-down game with a fixed size grid and grid-based movement, you should calculate the tile x and tile y at the player's position, and then check for neighbouring tiles using Compare Tile at Tile x Tile y

    Otherwise just use Object is overlapping at offset x y with offset that correspond to the 4 directions.

  • Thank you Ashley! That works! However, I'm unable to find the instance class for 9Patch objects. I think they don't have one (?). Is there any way I can tell if an instance is a 9Patch?

  • I encountered an issue where the editor would completely freeze for several minutes before resuming and working flawlessly again. This happened with a fairly large project (approximately 1,500 events and 2,000 lines of JavaScript). Interestingly, the freezing only occurred when positioning objects in the layout. While working in the event sheet, the editor never froze, though it did feel noticeably slower, especially when deleting events.

    To potentially improve performance, I tried organizing events into groups and keeping only the group I was actively working on open. While I think this made navigation a bit smoother and may have reduced some of the sluggishness in the event sheet, I’m not entirely sure it had a significant impact. It could be worth experimenting with, but the results might vary.

  • You'll need a little bit of javascript.

    First of all, give your button an id. That means you need to change

    <button class="glow-on-hover">Click Me</button>

    to

    <button class="glow-on-hover" id="btn">Click Me</button>

    then add an oncontextmenu event listener on the button with id "btn", suppress the default browser behaviour and call a function inside your event sheet to handle the event.

    Here's the code that does this:

  • I have a function that takes as input an instance of any object. Based on the plugin of the instance itself (Sprite, SVG, 9Patch, Text...) i want to perform certain different actions. Given an instance, how can i get its plugin back (using scripting, not normal events)?

    Here's an example of what I want to do:

    const spriteInstance = runtime.objects.player.getFirstPickedInstance();
    const svgInstance = runtime.objects.circle.getFirstPickedInstance();
    const textInstance = runtime.objects.title.getFirstPickedInstance();
    
    function performAction(instance) {
    	if(getPlugin(instance) == "Sprite") console.log("This is a sprite");
    	if(getPlugin(instance) == "SVG") console.log("This is a SVG object");
    	if(getPlugin(instance) == "Text") console.log("This is a text object");
    }
    
    performAction(spriteInstance);
    performAction(svgInstance);
    performAction(textInstance);
    
  • I used this script in one of my projects to do just that. Give it a try. Just place it in the event sheet.

    function pauseVideo() {
     var iframe = document.getElementsByTagName("iframe")[0].contentWindow;
     iframe.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
    }
    
    pauseVideo();
    
  • you wrote glow-on-hover. It's .glow-on-hover with a dot as first character.

  • I suppose you have your html inside of a HTMLElement object.

    Your button has "glow-on-hover" class attribute. You can then change its text using the HTMLElement action Set HTML content to YOUR_TEXT at ".glow-on-hover" (one), where .glow-on-hover is a css selector.

  • That's better. I notice that you have set timescale 0, but at the same time you try to perform a tween. That's what causes the issue. With timescale = 0, your tween simply stops executing, and that means that your menu will never re-appear. To fix this, filter out the menu from the global timescale. Just enter set object timescale = 1 for the objects that are supposed to move when pausing. Like this (I tested and it works as expected)

  • You can do it using YouTube API. You need a google developers account for that, and an API key. Then you need your channel_id (which you can find by going into your Youtube channel, right click -> view source, tick "line wrap" on the top-left corner, press CTRL-F and search channel_id. The result you want should be at the bottom.

    You can request multiple videos or just one video using the "maxResults" query parameter. Ordering by date is what gives you the last video you published. Note that these fetched videos will include shorts, and as far as i know it isn't possible to filter them out easily.

    Here's the code you need

  • That's because right now you're fetching the download link for your 3 images at the same time. Whenever a link is ready, you then apply it to all Flag objects, which is not correct. This results in every Flag object having the same image.

    To fix this, you need to create the first flag, fetch the download link of the first image, on link fetched load the image on the last created flag, and only after the image has been loaded correctly proceed to create the following flag and fetch the following image.

    Here's how you can do it. I can't test this since I don't have Firebase Storage, but give it a try: