cybertron7's Forum Posts

  • Heya, we never actually got this to work.

  • Hey cranberrygame I emailed you. Did you get it? I really want to move this project forward. Look forward to talking with you!

  • Would you be able to build a Google Chromecast Plugin? Lots of interest in it on these forums.

    I have it half working, I would be happy to send you what I have in my C2 plugin file already. There are existing Phonegap plugins for Chromecast.

    You could tie the two together perhaps, and make some more coin? Cheers,

  • Just found this. WOW.

  • Solution: Use the Construct 2 Plugin called "Phonegap IAP: in app purchase"

    Search for it the forums, direct link: /forum/plugin-crosswalk-related-c2-plugins-phonegap_t109586

  • Thanks Ashley,

    Like I said, I'm half way with it, but I just can't figure out a few things. C2_callFunction works for now. It's easy enough to transfer my code in natively.

    In time. Thanks,

  • Hi folks, just discovered Phonegap!

    My question is: How do I export my mobile game to use plugins such as Android Billing?

    For example, this guy here posted a plugin for Phonegap that does multi platform billing: How do I ... use this in Construct 2?

    http build.phonegap.com/plugins/921

  • Ashley - Could you PM me? I'd like to discuss releasing a Chromecast support plugin to the community, if your team is interested.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Folks, I was able to get it working!

    I was pretty close to making a native plugin for Construct 2. It recognized my app started and all that, but couldn't figure out how to have the Cast API listener always running.

    So I reverted to my nasty hack.

    After exporting the game, I simply edit index.html and add my external javascript API I wrote for Chromecast. Works like a friggin charm. I make heavy use of c2_callFunction("myFucntion", [1,2,3]);

    The more I use Construct 2, the more I absolutely fall in love with this. I'm going to make SO MANY APPS. You guys rock.

  • Hi guys, new here. FANTASTIC game engine.

    I'm trying to load in the Javascript library, which I've done so like this:

    	instanceProto.onCreate = function()
    	{
    		var self = this;
    		
    		
    		// ===================
    		//
    		// CHROME CAST ENGINE
    		//
    		// ===================
    		
    		console.log("Attempting to load cast_receiver.js");
    		
    		$.ajax({
    		  url: "http://www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js",
    		  dataType: "script",
    		  success: function(){
    			console.log("LOADED: cast_receiver.js");
    		  }
    		});
    		
    		console.log("Finished cast_receiver loading");
    [/code:3dqp1161]
    
    I can't figure out how to load this external JS any other way. 
    
    [b]Here is the next bit of code I'm having trouble with: [/b]
    
    [code:3dqp1161]
    // CHROME CAST INIT
    		cast.receiver.logger.setLevelValue(0);
    		window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
    		console.log('Starting Receiver Manager');
    		
    		// handler for the 'ready' event
    		castReceiverManager.onReady = function(event) {
    		  console.log('Received Ready event: ' + JSON.stringify(event.data));
    		  window.castReceiverManager.setApplicationState("Application status is ready...");
    		  console.log("Application status is ready...");
    		};
    		
    		console.log('COMPLETE:  Receiver Manager');
    		
    		
    		// handler for 'senderconnected' event
    		castReceiverManager.onSenderConnected = function(event) {
    			console.log('Received Sender Connected event: ' + event.data);
    			console.log(window.castReceiverManager.getSender(event.data).userAgent);
    
    		};
    		
    		
    		// handler for 'senderdisconnected' event
    		castReceiverManager.onSenderDisconnected = function(event) {
    		   console.log('Received Sender Disconnected event: ' + event.data);
    		  if (window.castReceiverManager.getSenders().length == 0) {
    			window.close();
    		  }
    		};
    				
    		
    		// handler for 'systemvolumechanged' event
    		//castReceiverManager.onSystemVolumeChanged = function(event) {
    		// console.log('Received System Volume Changed event: ' + event.data['level'] + ' ' +
    		//      event.data['muted']);
    		//};
    		
    		// create a CastMessageBus to handle messages for a custom namespace
    		window.messageBus =
    		  window.castReceiverManager.getCastMessageBus(
    			  'urn:x-cast:com.google.cast.sample.helloworld');
    			  
    		// handler for the CastMessageBus message event
    		window.messageBus.onMessage = function(event) {
    			console.log('Message [' + event.senderId + ']: ' + event.data);
    			
    			window.messageBus.send(event.senderId, event.data);
    		  
    		  
    		}
    		// initialize the CastReceiverManager with an application status message
    		window.castReceiverManager.start({statusText: "Application is starting"});
    		console.log('Receiver Manager started');
    		
    		
    		console.log("-- Complete --");
    [/code:3dqp1161]
    
    The next question will be how do I make a player move forward? This is the code (from above) that is receiving messages from my Android phone:
    
    [code:3dqp1161]
    		// handler for the CastMessageBus message event
    		window.messageBus.onMessage = function(event) {
    			console.log('Message [' + event.senderId + ']: ' + event.data);
    			
    			window.messageBus.send(event.senderId, event.data);
    		  
                            // ON A NORMAL JAVASCRIPT PAGE I COULD DO THINGS LIKE THIS:
                           $("#player").css({left: "+="+event.data});
    		  
    		}
    [/code:3dqp1161]
    
    Your help is appreciated