Toby R's Recent Forum Activity

  • Small update. It works fine on Samsung Galaxy S6. So it looks like it depends on mobile.

  • Problem is not in any plugin. I've created completely new blank project to test Audio. What I've added to the project:

    1. On tap gesture on: spriteObject -> play sound "Click".

    2. On touched: spriteObject2 -> play sound "Click".

    3. Every 1 second substact 1 from counter -> if counter == 0 then play sound "Click". (I wanted to test here if TAP event was delaying or play sound)

    RESULTS:

    a) In C2 preview mode it works good.

    b) In Intel XDK emulate mode it works good.

    c) In Intel XDK Debug mode (run app via USB on my mobile) sound delays about 0,5s for every above mentioned step 1, 2 and 3.

    d) Same delay as above for app installed on mobile with APK.

    I have the newest C2 version and newest Intel XDK version. There is absolutely no other plugin involved in this test. It is really hard to believe that only I have this problem because I am not doing anything fancy - everything is out of the box.

    Tested on Samsung Galaxy S4, Sony Xperia Z1, and some old LG (I don't know what is it exactly).

    Can someone confirm that he is using Audio object with Cordova + Intel XDK and it works fine without any delay? Any clue what can be done? How to debug the problem? I'm out of ideas already.

  • Thank you for the reply Should I include some audio plugin in Intel XDK? At the moment I use only cranberrygame plugin for adMob - nothing else.

  • Over 40 views and no replies. Does this mean that nobody has same problem or nobody knows how to fix it or maybe my post is not clear enough?

  • Hi,

    I have very small WAV (2kB or so) file which is triggered to play after user tap the button. For some reason it is delayed about 1 second.

    Some sort description of my project:

    1. I have "preload sounds" enabled in C2, but it is delayed everytime not only the first time it is triggered.

    2. Also tried with preload sound in "On layout start".

    3. I'm exporting as Cordova app

    4. Then wrapping to APK using Intel XDK to Android Crosswalk

    5. In C2 preview (HTML) it works fine, but once it is installed on android device it delays (tested on Samsung Galaxy S4 and Sony Xpreria Z1)

    Should I import some plugin in XDK? I'm realy lost here... what am I missing?

  • Hi all,

    I have some popups in my game and during popup is visible I would like to make the rest of the screen darker (lightbox effect). Now I have 2 ways to do in my mind:

    1. Create black sprite in Construct and give it some opacity.

    2. Create dedicated PNG (black with opacity) and use it in construct as it is.

    As I'm aware opacity is resource consuming but is there any advantage in efficency in those 2 ways?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Once you put your APK to the market (even as aplha test) and install application from Google Play then the shortcut will be created automatically.

  • Hi jogosgratispro,

    I've managed to make IAP work. There were few things which made a confusion so I will list them below, hopefully it wil help others as well.

    1. You should obviously read the tutorial for C2 IAP first.

    2. "Has Product" condition is not a check for availability of the product in store. With this condition you can check if customer has already purchased a managable product ( like "premium_account" or "remove_ads" not like "gold" or "coins"). It is explained in tutorial however I saw some ppl were using it in a wrong way (as did I) so I think it's worth to highlight this.

    So the correct way would be:

    On Touch("buy_button") -> Purchase product("gold1000")

    Incorrect is:

    On Touch("buy_button") -> if Has Product ("gold1000") -> Purchase product("gold1000")

    3. There are some examples using cranberrygame Phonegap IAP plugin, and this plugin requires a licence from Android Developer Console which seems to be very logic as this seems to be a kind of API Key for authentication. I spent a lot of time searching for a way to authenticate official IAP plugin in the same manner. I even thought that maybe it works with Google Play plugin (in this plugin you have to pass licence and app Id). But the answer was much easier - there is no need to provide any API key for C2 official IAP plugin. You simply add it to the project and use it without any configuration.

    I am sure those are obvious and trivial things for some of you, but those are the problems I had and I found some simmilar (unanswered) questions on this and other sites so it look like common problems/missunderstandings.

    It's also worth to mention that IAP can't be tested on any emulator so after every change you have to wait hours or days before market accept it as alpha/beta version so you can test your changes. I spent over a week to figure out those 2 "simple" problems. Hope it will help some of you.

    jogosgratispro I think you can change the topic title to "How do I use Google Play and IAP objects properly?" cause those two are also confused to be connected as well.

  • Hi everyone,

    I'm close to release my project for Android platform. I have a free version with ADs (and some other restrictions) and paid premium version. Now I'm wondering what is the right way to publish both in Google Play?

    == Option 1

    • publish both versions under different names and namespaces as separate applications,
    • in free version there would be a button "buy premium" which will simply open URL to premium version in google play
    • after purchasing premium version with a button inside free version, customer will have both apps on his mobile so he would have to delete free version manually

    == Option 2

    • publish only one app which will change it's behaviour based on some variable "isPremiumPurchased"
    • implement IAP feature to change this variable

    == Option 3

    Here I am not sure if this is possible, but I would imagine to have both free and premium versions available to download separately in Google Play store, but once the free version is installed and user will download the paid version, then it is not as a separate app but something like an upgrade of the free version. Is it possible to do something like that? I have read that there is a way to use a common library (or something like that) in both versions, but this is already more for coders and I'm wondering what is the right way to do it with applications built in C2.

    I know that Option 1 and 2 are more dependant on how I want to handle it but I'm more curious if something like described in Option 3 is possible and right/common way of releasing a project?

  • I keep asking for Google Play and IAP objects for a week already and got no response at all. So will keep track on this post as well.

  • I think this might be some work-around in general idea:

    [pseudo code]

    randomNumber1 = random(1..19)

    randomNumber2 = random(21..39)

    pickNumber = random(1,2)

    if pickNumber == 1

    return randomNumber1

    else return randomNumber2

    ---- or a bit prettier way ----

    pickRange = random(1,2)

    if pickRange == 1

    return random(1..19)

    else return random(21..39)

  • For security reasons AJAX calls should be done within one domain - that's why you can't connect to your PHP/MySQL from your app. There are several work-arounds. One of them is to create a .htaccess file in the directory where you have your index.php with the following content:

    <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    </IfModule> [/code:3boz2zyb]
Toby R's avatar

Toby R

Member since 23 Mar, 2015

Twitter
Toby R has 18 followers

Connect with Toby R

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

15/44
How to earn trophies