StillSarah's Forum Posts

  • 14 posts
  • DaniellMesquito

    Done! I just modified everything so that it is a complete working example of a platform shooting game. I included a multi-purpose controller that you can use for lots of different kinds of games. There are no HTML form elements -- everything is built entirely using Construct 2 sprite objects, text objects, and events.

    To play the game on AirConsole:

    https://www.airconsole.com/#https://dl.dropboxusercontent.com/u/55106174/acexample/

    Direct link to the screen file (this works with keyboard controls):

    https://dl.dropboxusercontent.com/u/55106174/acexample/screen/index.html

    Direct link to the controller file (you can try this by itself on your phone):

    https://dl.dropboxusercontent.com/u/551 ... index.html

    The screen's .capx can be downloaded here:

    https://dl.dropboxusercontent.com/u/55106174/acexample/platformshooterairconsoleexample.capx

    The controller's .capx can be downloaded here:

    https://dl.dropboxusercontent.com/u/55106174/acexample/multipleairconsolecontrollerexample.capx

    Notes on the controller .capx:

    -I designed the controller as a general-purpose controller. There are way more events and game layouts than you will actually use.

    -By pressing the "?" button, you can switch to different controller layouts and control schemes.

    -All directional messages sent from the controller begin with either "r", "c", "8", or "t". These characters indicate how the game should respond, and were intended to test different driving control schemes for a top-down driving game. They were extremely useful to quickly switch between different control schemes in the middle of the game, but you will most likely want to get rid of these extra events once you settle on a control scheme.

    Notes on the screen .capx:

    -This was a prototype for a platform shooter. Feel free to modify and use however you want.

    -I have extra events in here that strip out the "r", "c", "8", or "t" from the controller messages. For this game, they are not necessary, and I recommend eliminating everything that is unnecessary in your actual game.

    Notes on directory structure:

    -You will want to create the following directory structure for your project:

    -Always export your screen .capx to the screen/ folder.

    -Always export your controller .capx to the controller/ folder.

    -Create screen.html and controller.html files, as I described in this thread:

    https://www.scirra.com/forum/airconsole-controller-maker_t186227?start=130

    cjbruce the links to your example capx files are no longer working. Could you relink those files please? I'm having trouble getting this airconsole controller plugin working with the updated airconsole V2 screen plugin. Thanks!

  • Psychokiller1888 - yeah, the connect code right now is included somewhere in one of the controller's js files that is exported. I haven't had a chance to dig through and find it, but I'm sure it's there, like I said Android devices were connecting and even the iOS devices were connecting in initially too. Anyway, thanks for your thoughts on this. I don't know why copying the code into the controller.html file worked for me, I just know that it did. I've run several tests and gotten the same results each time. Thanks for all the work you've put into the airconsole plugin. Looking forward to trying out V2!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > cjbruce

    > I did find a fix for the iPhone reconnect issue in case anyone else comes across it. Several days ago I tried copying in the handshake code directly into the controller.html hoping that would solve the problem, and it had no effect. However, now it is suddenly working. Just copy:

    >

    > > <script type="text/javascript">
    >   var air_console = new AirConsole();
    > 
    >   var sendHandshake = function() {
    >     air_console.message(AirConsole.SCREEN, {
    >       handshake: true
    >     });
    >   };
    > 
    >   air_console.onReady = function() {
    >     sendHandshake();
    >   };
    > 
    >   // Let the screen know we are here
    >   air_console.onMessage = function(device_id, data) {
    >     if (data.handshake) {
    >       sendHandshake();
    >     }
    >   };
    > </script>
    > [/code:1ngo76fc]
    > into the controller.html file and it fixes this issue now.  Hopefully this helps others who run into this.  
    > Thanks,
    > Happy Game Designing!
    > 
    
    I don't understand, this is the default JS code for a standard connection...
    

    Yes, it is the default connection code. However, the controller plugin doesn't automatically put this into the controller.html file for you. So anyone using the controller plugin just needs to add it in manually. Android devices were connecting no problem without that code in the html file, but iOS devices seem to need it to be there to reconnect after disconnecting. This is just what I've observed in my own testing. It's possible that this was only an issue with my game and no one else will run into this, but from what I could tell, the on device join event wasn't getting triggered when iOS devices were trying to reconnect in, and copying the connect code right into the controller.html file fixed it for me.

  • cjbruce

    I did find a fix for the iPhone reconnect issue in case anyone else comes across it. Several days ago I tried copying in the handshake code directly into the controller.html hoping that would solve the problem, and it had no effect. However, now it is suddenly working. Just copy:

    <script type="text/javascript">
      var air_console = new AirConsole();
    
      var sendHandshake = function() {
        air_console.message(AirConsole.SCREEN, {
          handshake: true
        });
      };
    
      air_console.onReady = function() {
        sendHandshake();
      };
    
      // Let the screen know we are here
      air_console.onMessage = function(device_id, data) {
        if (data.handshake) {
          sendHandshake();
        }
      };
    </script>
    [/code:2arq7c42]
    into the controller.html file and it fixes this issue now.  Hopefully this helps others who run into this.  
    Thanks,
    Happy Game Designing!
  • cjbruce

    Thanks for looking into it. I am using the controller plugin, so right now I am trying to determine if it is an issue in the controller plugin or something on my end. I will let you know what I find. Thanks!

  • Curious if anyone else is running into the issue of iOS devices not being able to reconnect in after disconnecting? Android works just fine, only an issue on iPhones/iPads. After restarting the app on the device, they can get back in no problem. Any ideas on what could be causing this issue? Thanks!

  • Congrats Anonnymitet and Psychokiller1888! Great job, and I look forward to playing! I don't have a release date yet, but my game is Magic Cheese. This was a fun contest! Thanks again to Psychokiller1888 and X3M for all your work on the plugins!

  • Anonnymitet Yes, that's exactly what I did.

  • Just fixed my scaling issue by adding back in the first part of the CSS code:

    * {

    padding: 0;

    margin: 0;

    }

    Seems to be working perfectly now.

  • Note: The js error is gone, but still have continuous up-scaling issue on iOS. js error was from the airconsole plugin object being accidentally left in the controller.

  • Still no luck. I will keep at it, but let me know if you think of anything else that could be messing with the scaling settings. Thanks!

  • X3M Ah, the scaling fix is not working for me. I get a js error and the controller continues to scale up and makes it unusable. Error says "Uncaught TypeError: Cannot use 'in' operator to search for '4' in Pause. Any ideas of what I could try? I've tried it using Scale Inner and Scale Outer within Construct2 and neither work correctly for me. I will keep looking at it, but any advice would be much appreciated. Thanks!!

  • X3M Thank You!!! for the fix and for the controller plugin! You rock!

  • X3M Any progress on the iPad/iPhone scaling issue? I am also running into this. Has anyone reached out to the Airconsole team? Thanks!

  • 14 posts