Implement Spilgames API

0 favourites
  • It seems you can't test games with HTTPS urls anymore though, which means you cannot use dropbox. <img src="smileys/smiley19.gif" border="0" align="middle" />

    I tried to use a sub-domain Redirect & Frame to the dropbox link of the game, then the API test tool worked! But I don't sure why the Status Check (even showing logo or ads) of API test tool didn't work with my game - because of my wrong in using the event or because of loading via the Redirect & Frame of sub-domain.

    By the way, this is my event. I called loadAPI at the first layout, then request ads and get logo on start of the highscore layout when first any touch start condition checked, but no ads nor logo is shown..

    Anyone have experiences?

    <img src="http://i.imgur.com/BW6sQp5.jpg" border="0" />

    Links of the game:

    tapforfunapi5.gamesvts.com

    or

    dl.dropboxusercontent.com/u/63199844/TapForFunAPI5/index.html

  • How do you actually submit a game. Their whole dev portal seems really incomplete. Is there an email address we send links too?

    Thanks

  • How do you actually submit a game. Their whole dev portal seems really incomplete. Is there an email address we send links too?

    Thanks

    SpilGames works with a number of different managers, you can submit your game via a contact email address. Then they will reply and let you know what your game's future is :D Just pm every one in this thread or me if you really need it :D

  • OK, so it's like boostermedia. I will just send an email via their contact form.

    You guys are having success getting games passed, even though the API Loaded is failing during the test?

  • ArcadEd

    The "API loaded" lights up green in the test tool if you include the API from the URL like described in the documentation. Since you can't define remote dependencies the plugin uses a local copy of the API js file.

    Feel free to replace the script reference in the index.html file of the exported project.

    However skyhunter93 submitted successfully even though his project worked with a local script, so it might not be necessary.

    Iris

    You probably don't want to request an ad right on startup. That would mean the user instantly saw an ad after loading the game.

    I'm also not sure it will work properly if you don't allow for a little time between loading the API and requesting an ad.

    Remember, you load the API only once and you request an ad whenever you want to actually display one. For example when a level ends.

    Could be that the sub-domain redirecting you're doing is causing problems with the test tool. I would definitely try to use a direct URL to compare.

  • PixelRebirth,

    Is there an api call to check to see if the API has loaded? That way we can check to see if the api loaded before doing the other calls?

    Thanks for all the work.

  • Ok, I got all three greens. Here is what I did.

    I used Pixel's plugin, but didn't load the api from it, did that in the index.html file

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/29e8b816-eff7-48d8-af50-b568b64ef267/2014-02-11_1226.png" border="0" />

    Then used the plugin to call Get Logo on the start of layout for my title screen.

    After the user hits play, my game has a window with instructions. At this point I requested Ads (on start of layout). Since my game is already paused and waiting for use input it was a good spot to call the ad. I could also call it when the level is over.

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/e0b22817-6d06-43ac-8b77-0191d039f42f/2014-02-11_1230.png" border="0" />

    I'll contact spillgames now and see if any of my games fit in with their network.

    Thanks for all the hard work on this thread!!!

  • ArcadEd: Thanx dude.. thanx for the image tutorial. it made my game turn green the API Loaded and In-Game Ads call. However, I am not getting when to call the branding logo event. Can you please tell me where and on which event you called the GetLogo call ??

  • On the Start of Layout for my title screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • SPIL gave me a GGG.com logo image and wanna implement it to the game using their API. So I wonder I if just only used the Get Logo action of PixelRebirth's plugin or had to do any other steps for showing the clickable logo?

    I think that we could use both of the plugin for a well testing result and placing the logo to the game manually. But I don't sure about it.. :(

  • PixelRebirth,

    Is there an api call to check to see if the API has loaded? That way we can check to see if the api loaded before doing the other calls?

    There isn't yet. But I plan to have at least an expression covering this in version 1.0 of the plugin.

    SPIL gave me a GGG.com logo image and wanna implement it to the game using their API. So I wonder I if just only used the Get Logo action of PixelRebirth's plugin or had to do any other steps for showing the clickable logo?

    I think that we could use both of the plugin for a well testing result and placing the logo to the game manually. But I don't sure about it.. :(

    The "Get logo"-action is in place to dynamically get logo data (image url and link). Likely used for having one version of the same game on their various portals (different logos)and in case they change the logo.

    Anyway - if Spil provided the logo just go ahead and add it manually in C2 I guess. I hope I understood your issue correctly. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Hmmm, seems like an intersting topic, so allow me to barge in (:

    PixelRebirth

    To me the way you use the GameAPI.loadAPI() is wrong, the aim of this function is to provide a "trigger" for when the API is loaded

    So you should probably create an OnLoaded trigger instead of having a function that just call the loading.

    It's like saying "Send this AJAX request and.... blah"

    The way you should be able to do that is:

         instanceProto.onCreate = function(){
              this.API = null;
              this.gamePaused = false;
              GameAPI["loadAPI"](function(API) {
                  ?this.API = API;
                  ?this.runtime.trigger(cr.plugins_.pix_spilgames.prototype.cnds.OnLoadAPI, this);
              });
         };

    with the corresponding condition just returning true

         Cnds.prototype.OnLoadAPI = function () {
              return true;
         };
            // and because we can:
         Cnds.prototype.isAPILoaded = function () {
              return this.API != null;
         };

    This way the C2 user can start doing things here.

    The same way, you should probably provide triggers for OnGamePaused, OnGameResumed

         Acts.prototype.RequestAd = function ()
         {
              // alert the message
              //GameAPI.GameBreak.request(fnPause, fnResume);
              GameAPI["GameBreak"]["request"](
                  ?function() {
                        // pause
                        this.gamePaused = true;
                        this.runtime.trigger(cr.plugins_.pix_spilgames.prototype.cnds.OnGamePaused, this);     
                  ?},
                  ?function() {
                        // resume
                        this.gamePaused = false;
                        this.runtime.trigger(cr.plugins_.pix_spilgames.prototype.cnds.OnGameResumed, this);     
                  ?}
              );
         };

    With the corresponding

         Cnds.prototype.OnGamePaused = function () {
              return true;
         };
         Cnds.prototype.OnGameResumed = function () {
              return true;
         };
            // why not
         Cnds.prototype.isPaused = function () {
              return this.gamePaused ;
         };

    With all that you shouldn't need to put anything in typeProto.onCreate

    And please, note that it's on the top of my head and that I dunno too much about how spilgames works, but It should work :D

  • Yann

    Great! I knew I had to start using proper triggers where appropriate, but to be frank I would have had to yet look into it. My actual coding skills are still... in development :)

    Seems you laid it all out for me here. This is obviously much better and I shall adapt it right away in the next version. So thank you for that!

    One thing I did intentionally was making the GameAPI.loadAPI() an action and not be executed at "onCreate". The idea was to keep full control and load the API at a later point if necessary. But I realize that case might not be very realistic anyway. If you add the plugin you probably want to load the API asap...

    Anyway, thanks for your detailed post! Will help to improve the plugin a lot.

  • PixelRebirth

    Actually you could still implement your idea.

    For example you could have an autoload property in edittime you could set to yes or no

    You can get this property on create, if it's true you load the plugin and the trigger will be... triggered (as I did it)

    If it's false the user can still call the load action (as you did) and there you would provide a callback that will call the trigger (instead of an empty function)

    However, doing that you give the possibility to the user to load the API more than once... And I'm not sure that in the end it would be a good design choice (not sure what would happen either)

    So yeah, in the end I would stick with auto loading it. (Yeah I'm thinking while typing)

  • Wow. This is great work. Has there been any updates to this PixelRebirth?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)