makarone's Recent Forum Activity

  • Hi Guys, i'm spending a lot of time in searching how to get js data from the external js file, but no luck.

    I have added *.js file to the project folder, and i need to pick a function from this file.

    So, if this function or value inside of it is true(or exist), i'm switching my value inside a Construct and executing new js

    Is anybody know how to do that? Or maybe you can point me to the existing tutorials that i missed.

    Many thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sometimes, we need to remove sound from the problem devices like galaxy s3, sharp, xperia Z , and hide audio button on them.

    I found a solution for that.

    First, we need to add an events and global variable to a project:

    [attachment=0:3a3k6fdi][/attachment:3a3k6fdi]

    Then, we need to export the game and add a code to the index.html

    // Create new runtime using the c2canvas
    			cr_createRuntime("c2canvas");
    
    //put a code right here in your index.html
    
    });
    
    //CODE
    var ua = navigator.userAgent.toLowerCase();
    		var isSthree = ((/gt-i9300|gt-i9305|gt-i9301|sgh-n064|sgh-n035|sch-j021|sgh-t999l/i).test(ua)); 
    		var isSharp = ((/SHL24|SHL23|SHL22|SHL25|SHL21/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isXperia = ((/D6603|D6616|D6633|D6643|D6653|L55t|L55u|D6708/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isXperiaZ = ((/C6602|C6603|C6606|C6616|SO-02E/i).test(ua)) && !/(firefox|opera|chrome)/i.test(ua);
    		var isIE10 = /MSIE 10/i.test(navigator.userAgent);
    		var isTest = false;
    		// var isTest = false;
    		 
    		delete sessionStorage.rm_disablesound;
    
    		if (typeof (Storage) !== "undefined")
    		{
    		  if(isSthree || isSharp || isIE10 || isTest || isXperia || isXperiaZ) 
    		  {
    		   sessionStorage.rm_disablesound = 1;  
    		  }
    		}
    
    		[/code:3a3k6fdi]
    
    That code was written not by me and i can't explain it  throughly.
  • SOLVED.

    Create blank sub event under your main evet ( for example "button was clicked")

    Select System- Compare values

    Compare:

    LayoutName

    = Equal to

    "enter layout's name" - with quotes

    And then add action to switch to the required layout.

    Works!

  • Thanks for the answers, but this is not what i need.

    For example, i have 3 layouts (A,B,C)

    I have a button BTN

    Each layout has this button

    And all 3 layouts controls by !one same Events sheet

    I need to write in this sheet- If i press the button BTN and if the current Layout name is Layout A i need to switch the game to the layout B. On the Layout B i need this button move me to the layout C and if i will put this button at the Layout C i need to go to Layout A.

    How to use these control in the single Events sheet?

    Thanks

  • Hey guys!

    I want to make a button which will work in one Events sheet.

    By pressing this button i need to switch layout

    If the current Layout is = (Layout 1) then go to Layout 2 and so.

    How can i get the layout name as an sub event or event.

    Thanks!

makarone's avatar

makarone

Member since 20 May, 2014

Twitter
makarone has 19 followers

Trophy Case

  • 10-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies