Airconsole controller maker

Post your completed addons to share with the community

Post » Mon Mar 06, 2017 2:42 pm

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
Code: Select all
<!DOCTYPE html>
<html>
<script type="text/javascript">
   window.location.href = "screen/index.html";
</script>
</html>


controller.html
Code: Select all
<!DOCTYPE html>
<html>
<script type="text/javascript">
   window.location.href = "controller/index.html";
</script>
</html>


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.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
11
G
20
Posts: 363
Reputation: 14,199

Post » Mon Mar 06, 2017 3:01 pm

@cjbruce I thought of that before but the problem is that Airconsole expects the screen.html and controller.html files to be in the root directory. So unless the Airconsole team adds the option to set the directory of them individually, we cannot do much about it.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Mon Mar 06, 2017 3:36 pm

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...
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
11
G
20
Posts: 363
Reputation: 14,199

Post » Mon Mar 06, 2017 5:36 pm

@X3M,

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

Drat.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
11
G
20
Posts: 363
Reputation: 14,199

Post » Mon Mar 06, 2017 6:27 pm

@cjbruce Here are some tips :
- Finish up the controller first, and then work on the game.
- You don't need to rename the index files a second time, because the index.html and old screen.html or controller.html hold the same code. All changes are occured inside the c2runtime.js file.
- Always start your projects off the pong game and controller example.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Mon Mar 06, 2017 6:33 pm

@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.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
11
G
20
Posts: 363
Reputation: 14,199

Post » Mon Mar 06, 2017 7:04 pm

@cjbruce Have they announced the winners yet ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,964

Post » Tue Mar 07, 2017 3:23 am

@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. :)
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
11
G
20
Posts: 363
Reputation: 14,199

Post » Fri Mar 10, 2017 4:42 pm

Ads do not seem to work properly. They are not always displayed when indicated. Who else is this?
B
10
S
2
Posts: 205
Reputation: 1,619

Post » Fri Mar 10, 2017 5:36 pm

Ads do not display if a premium device is connected
B
29
S
11
G
3
Posts: 212
Reputation: 4,168

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests