Embedding a game on a Joomla Site

0 favourites
  • 4 posts
From the Asset Store
A set of vector game assets contains ground tiles and several objects, used for creating platformer games
  • Using the Sourcerer plugin I have included the the body section of the Contruct index.html file in my article.

    I then edited <script src="c2runtime.js"></script> to be <script src="http://mygameshost/c2runtime.js"></script>

    The problem is that the JS file refers to the images and media via a relative address and I need it to point to an absolute, fixed address. I tried editing c2runtime.js file and it just breaks.

    Any ideas?

  • What I should have been clearer about is that the Joomla and Construct hosts are two separate hosts.

  • Seeing as how your game and the Joomla page are hosted by different hosts, I'd refer you to the use of iframes.

    It's good enough for cross-domain content, though should be avoided if the iframe is pointing to the same domain it's on.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK so I got it to work 100%.. and this is how

    When exporting to HTML I set the folders as follows:

    games/sc/images

    games/sc/media

    I then uploaded the games folder to the root of my Joomla host. I also uploaded jquery-1.7.1.min.js, c2runtime.js and logo.png to the Joomla root.

    I edited the c2runtime.js changing all occurrences of games/ to ../games/

    The body section of index.html I pasted into the required Joomla article using the sourcer plugin.

    So that I could add more games in future I renamed c2runtime.js to c2runtime-sc.js and updated its reference to such in the article body :-)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)