Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

A Little Push

John_G_10
Beginner
588 Views

Hi

Can someone give me just a little push please.

I am seeing many examples out there, but everyone seems to have a different approach. None of the examples I have seen out there use the app.js approach found in the default Phaser template in the intel xdk, The only examples that I find use this method, are the examples in the xdk. For example the Html5 examples.

/*
 * Please see the included LICENSE.md file for license terms and conditions.
 */

(function() {
    
    // Wait for DOM tree is ready for access
    document.addEventListener('DOMContentLoaded', function() {
        var canvas = document.getElementById('gameScene');
        // make canvas full screen
        var width = screen.availWidth;
        var height = screen.availHeight;
        canvas.width = width;
        canvas.height = height;

        // get canvas 2d context
        // With canvas 2d context, you can draw anything freely on the canvas.
        // See https://docs.webplatform.org/wiki/tutorials/canvas/canvas_tutorial
        // for tutorials of using canvas.
        var context = canvas.getContext('2d');

        // load and draw image on the canvas
        var img = new Image();
        img.onload = function() {
            context.drawImage(img, (width - img.width) / 2, (height - img.height) / 2);
        };
        img.src = "asset/logo.png";
    }, false);

}());

...but that's as far as it goes.

This seems to be a nice approach, although I am sure the others work as well. However, I usually like to use the IDE's default, because I know these guys are experts at what they do.

To cut to the chase, what I  basically am trying to do is get from app.js to game.js. In other words, I want to get from the spinning bear to actually starting the game. I know that would probably mean creating a listener for a click or tap, which would then jump to the game, but I don't know where to start since this is all new to me. I have seen examples that use 

SideScroller.game.state.add('Boot', SideScroller.Boot);

SideScroller.game.state.start('Boot');

...as in the SideScroller example.

Can someone give me just a slight push in the right direction to get started building on the Phaser Standard Html5 Game Template? Thanks 

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
588 Views

The format of your app is quite flexible. The samples and templates have been developed by a variety of people, and in some cases, have been borrowed from other examples (especially the game samples you are referring to). The best experts for those game engines are the developers and experienced users of those game engines.

The Intel XDK provides you with some tools to build packaged HTM5 mobile apps. We do not try to prescribe how you construct your app. What we can help you with are things like how to debug, problems with building/packaging, and uncovering plugins to extend your HTML5 app so it can utilize features of your app that would normally only be available to a native app.

For basic information about the Intel XDK and what it does, please start here: https://software.intel.com/en-us/xdk/docs/lp-introduction

For some information about Cordova apps (which is what the Intel XDK creates), see http://cordova.apache.org/docs/en/4.0.0/, especially this page: http://cordova.apache.org/docs/en/4.0.0/guide_next_index.md.html#Next%20Steps

For details on how to write HTML5 apps, in general, using HTML, CSS and JavaScript, see w3schools and HTML5 Rocks and Mozilla Developer, etc. We do not have the resources to provide educational support for how to write HTML5.

View solution in original post

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
589 Views

The format of your app is quite flexible. The samples and templates have been developed by a variety of people, and in some cases, have been borrowed from other examples (especially the game samples you are referring to). The best experts for those game engines are the developers and experienced users of those game engines.

The Intel XDK provides you with some tools to build packaged HTM5 mobile apps. We do not try to prescribe how you construct your app. What we can help you with are things like how to debug, problems with building/packaging, and uncovering plugins to extend your HTML5 app so it can utilize features of your app that would normally only be available to a native app.

For basic information about the Intel XDK and what it does, please start here: https://software.intel.com/en-us/xdk/docs/lp-introduction

For some information about Cordova apps (which is what the Intel XDK creates), see http://cordova.apache.org/docs/en/4.0.0/, especially this page: http://cordova.apache.org/docs/en/4.0.0/guide_next_index.md.html#Next%20Steps

For details on how to write HTML5 apps, in general, using HTML, CSS and JavaScript, see w3schools and HTML5 Rocks and Mozilla Developer, etc. We do not have the resources to provide educational support for how to write HTML5.

0 Kudos
John_G_10
Beginner
588 Views

Thanks for the info.

I actually found a good starting point with the standard html5 template. It's well commented. I didn't examine all the files before. Now I have a better understanding. I also found a good example, which I am breaking apart to understand the works, and I'm making progress. I really love working with Intel XDK. It's a great IDE. Thanks.

0 Kudos
Reply