Spax's Forum Posts

  • By the way ... this is the Script i used :

    var URL_1 = "media/music_menu.m4a";
    var buffer_1; // important
    var audioCtx_1 = new (window.AudioContext || window.webkitAudioContext)(); // maximum 6x are allowed
    var xhr_1 = new XMLHttpRequest();
    // -----------------------------------------------------------------------
     xhr_1.open('GET',URL_1, true);
     xhr_1.responseType = 'arraybuffer';
     xhr_1.onload = function() { audioCtx_1.decodeAudioData(xhr_1.response, onBufferLoad_1);
     }; xhr_1.send();
    		
    function playBeginning_1() {
     source_1 = audioCtx_1.createBufferSource();
     source_1.connect(audioCtx_1.destination);
     source_1.buffer = buffer_1; // important
    	source_1.loop = true; // true, false
     source_1.start(0);
    };
    
    function onBufferLoad_1(b) {
     buffer_1 = b; // important
     playBeginning_1(); // plays imidiantly, after loaded
     //source_1.stop(0); // prevent direct play & enabels direct trigger
    };
    // -----------------------------------------------------------------
    play_1_snd = function() { // Music - MENU
    playBeginning_1();
    }
    
    stop_1_snd = function() {
    source_1.stop(0);
    }
    

    Maybe it can be useful for someone else ....

  • Oh really ?

    Thats great ! But somehow it didn´t worked for me. Maybe i did something wrong?

    I used the "Audio"-item and later on, in the commandsheet i tell the object to "play" the specific file (*.ogg / *.m4a). Usually if the user do his input, it plays. And strangly with a delay... No idea why.

    But also when the "next" Level starts, it should play sound without user input. This didn´t worked. "..Browsers mute audio until the first user input... " <- with my script you really don´t need input. It starts playing sound without any input. Just type the webAdress and it goes on.

    I have C2 r265

    Android 5.1 , newest chrome

    Android 8.1 , newest chrome

    Is there any Tut. about this topic? Or any example files, i can learn form ? I did a search in the formus after "sound mobile" / "delay mobile", etc. But didn´t find any thread about this. (On Desktop for instance, everything runs like a charm).

    I have to mention, that the C2-Engine on mobile is pretty damn fast ! Almost faster as many other HTML5 Engines! And you can run stuff really good as "Web App". Just now ...i am a bit struggleing & i hope to find a good way, with the audio play on mobile with C2

  • I discovered some limitations on mobile. So i wasnt sure what & why exactly. But gladly i found a small-"mention" in the construct2 documentation :

    scirra.com/manual/109/audio (check the Header "Mobile Limitation")

    Than i was serching for a workaround. And i found something interestant. You can achieve audio playback without "user interaction / input". And it works ! (on Android. On iPhone it doesn´t work)

    The workaround is called: "AudioContext"

    ( developer.mozilla.org/en-US/docs/Web/API/AudioContext )

    I was able to handle this with construct 2 and "extern" JS-script. Thanks to a C2 plugin called "ValerypopovJS". It is just nasty to do something by hand. What i also found out, is:

    1.) On 6y old devices i got a sound-Delays

    My guess is, that i cames from the "communication" of C2 to external JS-script. What do you think? Could something like this use too much power of the CPU ?

    Some questions about this topic:

    2.) Is there any plugin out there, which handles this problem in a elegant way ?

    3.) If not, would it be a big deal, if someone could write one ?

    4.) Would it be more performant, to put the AudioContext-JS script inside the C2 sheetboard, instead into an external JS-file ?

    5.) Does anybody else expirienced also the same behaviour on mobile-devices ? And what workarounds did you used ?

  • Okay ... something like this is achieveable ;-)

  • Okay ... got it

  • Oh okay. But what is the alternative ? Or what is the better solution ?

    I allready tried the regular export = cordova (used cordova CLI). It gives an APK output which is around 3mb big. It also works, but it has semi-good performance on many phones i tested. You would think: ...nice. Its smaller than cocoon.io. Yes it is. BUUUUT ... as said, it isn´t performant as cocoon.io is!

    I hope you can help us, finding the best export-process (performance wise) / best APK wrapper, etc.

    EDIT:

    What was the reason moving away from cocoon.io ?

  • I like to use the cocoon.io apk process, to pack my HTML5 C2 project / game inside it. I prefer this over a crosswalk / XDK because it:

    - use less space (APK is around 7mb)

    - very performant (in comparison to other)

    - and so on..

    But i also got some issues, therefore some questions:

    1.) I am not able to close my app, by the command: "canvas+, exit app" ( and even with "Browser, Close" it doesn´t work)

    2.) The usual C2-"Buttons" doesn´t work with canvas+, cocoon.io . Why ?

    3.) A HTML-div / iFrame plugin also doesn´t work here. Why ?

    4.) webGL / ThreeJS / 3D doesn´t seems to work with cocoon.io / canvas+. Whats wrong ?

    5.) Are there any tutorials out there, which shows you how to create cordova in combination with cocoon.io APK ?

    Thats it, for now. Feel free to answer all questions :-)

    Cheers

    Spax

  • You do not have permission to view this post

  • I guess that means $5000 bukks per month, right ?

  • Construct 2 itself is portable....but if you want to export a game you need the NodeWebkit. And NodeWebkit seems like to be also portable. BUT, if you install C2 as portable, and NW as portable, they don´t communicate together !!! And without NW = C2 is useless ! (only if you install C2 and NW on same machine, it works....but if you carry it on usb to another machine = doesn´t work)

  • Construct 2 itself is portable....but if you want to export a game you need the NodeWebkit. And NodeWebkit seems like to be also portable. BUT, if you install C2 as portable, and NW as portable, they don´t communicate together !!! And without NW = C2 is useless ! (only if you install C2 and NW on same machine, it works....but if you carry it on usb to another machine = doesn´t work)

  • I tried it again. With a new construct2 r210 and newest NW. No succes . As you mentioned i have to remove an older vers. of NW. But i don´t need to, because i´ve never installed a NW on my working windows 8.1 (i used a Virtual Machine and copied NW to root of Construct 2). And if i run NW it works. But inside C2, it shows the same error message.

    Without a "portable" working NW in combination with C2, Construct2 isn´t portable anymore. I don´t like this direction of development. Because i have my important Apps on my Pen, so i often work on different Computers.

  • Got a prob with the new nodeWebkit. As you might know construct is portable, means after a install i can carry it for instance to my laptop, without to install it again ! I like this very very much . Whats wrong with the construct logic ? Why is it doing this ? Why there´s not a better option to integrate this strange nodeWebkit ? What i want is simple: to let construct point out, where the nodewebkit is installed. Best thing is, i got also an error that it can´t extract stuff: "Cannot extract package" ... Failed to unzip the package file: D:\blabla\Construct 2\http://localhost:50000/ ... ????????????

    Please can someone fix this. Otherwise i have always to install the whole stuff again and again and again (if i restore my Windows images 2x times a week). And if anyone have a solution for a portable nodeWebkit in combo with C2, please let me know . Thx.

  • I like your idea, Somebody. Also very nice clean "readable" Mock-Up of the UI suggestion. Top. About the Node-Sys. I also doing Games with Unity, and have PlayMaker. What i really like. BUT: there is this Spaghetti prob. If my Game gets to komplex, i don´t get the complete overview of my logics. For Construct: i like the brick / line system. But if you have lots of lines it gets long and you also lost your view of the whole picture. Plus you have a lot of sheets / Levels, you can also get lost. Therefore maybe a clever combination of these two systems can manage this. Have to say that a friendly UI is a hard task. If i want like to have instances of a logic a code, i can image the node-sys would fit these needs best.

    Many coders say: Textbased is the best for the overview. But if you have 2000 lines of code, its not fun to search something specific. I don´t like to scrolling up n down. Anyway, as said in construct for the lines, i can image to integrate something like: "open / close" a topic of a logic consturction of maybe 20 lines. This would improve the overview, i guess.

  • Thanks for a preview. It looks really good & brutal . It reminds me a bit to "Jurrasic Park" (one of my favourite movies). How big is the map you have created ? And how many dinosaurs / objects are interacting with each other ? I guess you have to hunt and feed the big guys...right

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads