cjbruce's Forum Posts

  • Hmmm... I haven't used the "On tab gesture" for any of my projects. I typically use "On touched object" for buttons.

  • Sweet! We are too! After the 10th we should make a thread for all of the AirConsole games made with C2.

  • Anion,

    You don't actually have to create a separate mobile version -- everything can (and should) be done directly in your existing project. I recommend the following:

    1. Add the "Touch" object, and use it instead of all mouse inputs. They work pretty much the same way, you just lose the ability to hover over something.

    2. For the textfield, keep track of when it loses focus and enable the button afterward. If it isn't losing focus properly, you can manually close the keyboard and enable the button on any touch that is received outside of the textfield.

  • Nice work, and best of luck in the competition!

    Are you guys launching on the 10th?

  • ,

    Food for thought, if you want to really go nuts with the math:

    1. The damage can be expressed as proportional to the loss in kinetic energy, which is proportional to the square of the change in velocity.

    2. In real life, this damage would be distributed over a volume. How this volume of damage appears from a 2D side view could be completely unpredictable depending on the internal structure of the car and where the car was hit.

    In the end, the random approach might be the best-looking model of all. I would totally go with it if it looks good.

  • X3M,

    Not yet! The AirConsole team was at GDC in San Francisco last week, and I imagine they are up to their eyeballs in play testing at the moment. They are planning to announce the winners on March 10th.

    I've got my fingers crossed that someone in the Construct 2 community makes the top three. It would be pretty cool if one or more of us win.

  • X3M,

    Thanks for the suggestions and for your hard work getting this together.

    Unfortunately for me, my first task will be to retrofit an old project with the new controller. I'll do it this way for any new projects though.

  • X3M,

    I just tried my technique above, and you are correct -- the redirect doesn't work.

    Drat.

  • Both screen.html and controller.html would permanently reside in the root directory, but they would redirect to the new directory as soon as they load. I admit that I haven't tested it yet, as I don't yet have a working version of a game with both plugins. I'll try as soon as I can...

  • Hey guys,

    While working on another project, I came upon a solution that might be really elegant for AirConsole:

    THE PROBLEM

    Up until now, we have used the AirConsole Controller plugin (by X3M) and the official AirConsole plugin (by AirConsole team, with lots of improvements by Psychokiller1888) together by exporting both into the same root directory. This creates a hassle because then you have to rename the files and change the exported code. This significantly slows down testing.

    THE SOLUTION

    Instead of exporting them both into the root directory and deconflicting the exported index.html, c2runtime.js, and data.js files, do the following:

    1. Create a subdirectory within the game directory called screen/. Export your screen code (using the official AirConsole plugin) to this subdirectory.

    2. Create another subdirectory within the game directory called controller/. Export your controller code (using the AirConsole Controller plugin) to this subdirectory.

    3. In the root directory, create the following two files. These files never need to be changed:

    screen.html

    <!DOCTYPE html>
    <html>
    <script type="text/javascript">
    	window.location.href = "screen/index.html";
    </script>
    </html>[/code:1vtan5zp]
    
    controller.html
    [code:1vtan5zp]<!DOCTYPE html>
    <html>
    <script type="text/javascript">
    	window.location.href = "controller/index.html";
    </script>
    </html>[/code:1vtan5zp]
    
    Now you can keep the projects separate, always export to the same directory, and never have to change the names or any of the code in either of the exported projects.
  • I just realized that I have been going about this all wrong. All I have to do is redirect the user to the new directory. Here is the final solution.

    <!DOCTYPE html>
    <html>
    <script type="text/javascript">
    	window.location.href = "content/index.html";
    </script>
    </html>[/code:1qlphgbt]
    
    If anyone is making games for AirConsole, or similar, this should work as a way to separate the controller.html and screen.html files.  Just use a redirect for each of them to the appropriate directory, and you are all set.
  • So far no luck with Solution #1.

    Solution #2 is working fine on my desktop Safari browser, but it is doing weird things on my iPad, iPhone, and Nexus 5:

    1. Resizing no longer works correctly on screen rotations for mobile devices. It does not scale down below the menu bar, meaning the top portion of the display is covered by the menu bar.

    2. On my iPad it takes a very long time for the scale to autofit to the screen width. On my iPhone, it doesn't autofit at all. On my Nexus 5, it auto fits instantly and correctly. This appears to be a problem with the Q3D plugin, as the behavior completely changes when I set the Q3DMaster object scale/position to "Positioned" instead of "AutoFit". QuaziGNRLnose, any ideas?

    It is definitely good enough for desktops and chromebooks, but there are a lot of iPad-only schools (I work in one), and mobile users that PBS is hoping to target as well.

    https://dl.dropboxusercontent.com/u/55106174/pbstest/index.html

    Here is my code so far:

    <!DOCTYPE html>
    <html>
    <body style="background-color:black;margin:0;padding:0;overflow: hidden;">
    
    <iframe src="content/index.html" style="width:100vw;height:100vh;min-height:100%;min-width:100%;border:none;">
      <p>Your browser does not support iframes.</p>
    </iframe>
    
    </body>
    </html>[/code:3mkkjflx]
  • The good news:

    We just received word that PBS Learning Media http://www.pbslearningmedia.org is interested in several of the simulations and tutorials at http://www.simbucket.com. Everything on the site is made with Construct 2. It is a huge feather in Construct 2's cap, as PBS content is seen by millions of students around the US every year.

    The problem:

    PBS Learning Media has very strict guidelines for what can be ingested into their CMS system. The guidelines are available at https://projects.pbs.org/confluence/display/DLM/Media+Format+Guidelines#MediaFormatGuidelines-Interactives. I am having trouble modifying the exported project files to meet their requirements:

    [quote:134ipu7f]Only the index.html and the manifest.txt files should be located in the root of the archive. All other files should be contained in a subdirectory called content.

    I have attempted the following solutions:

    SOLUTION #1 - Create a folder called contents/, and put everything there except the index.html file. In order to do this, I need to modify all of the paths in index.html, c2runtime.js and data.js to refer to the contents/ folder for all resources. Does anyone know where I would change this in the exported code? I have tried every path reference I could find in c2runtime.js and data.js, and nothing seems to work. I have a few simulations made with previous versions of Construct 2 before the existence of the data.js file, and I can get those working fine.

    Ashley, is it possible to tweak something in C2 or in the exported files to achieve the proper directory reference?

    SOLUTION #2 - Set up an iframe within an index.html file in the root directory, then export the C2 project to a subdirectory called contents/. Here's my attempt so far: https://dl.dropboxusercontent.com/u/55106174/pbstest/index.html

    Here's what I have so far for the container index.html:

    <!DOCTYPE html>
    <html>
    <body>
    
    <iframe src="content/index.html" style="min-height:100%;min-width:100%;">
      <p>Your browser does not support iframes.</p>
    </iframe>
    
    </body>
    </html>[/code:134ipu7f]
    
    It doesn't look great: The iframe shows up with a 1px border, the container document has a white background while the iframe has a black background, and the iframe content is slightly smaller (10 px maybe?) than the container document.  Are there any web gurus out there who know how to take care of these issues?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe you could split the problem up and compute the paths one at a time?

  • i think you are looking to create a scrolling list. There isn't a default plugin that is designed to do this, but there are a number of examples of scrolling GUIs already built for you on the Scirra store. You should be able to modify one of them to fit your needs.