Suikama's Forum Posts

  • 15 posts
  • I tried the workaround (using the older version of Node Webkit) and now it works just fine so it's solved enough for me

    Hopefully the next version of Node Webkit fixes things for good though.

  • https://www.scirra.com/forum/viewtopic.php?f=146&t=95506

    Oh thanks! I didn't think to check general discussion for some reason

  • Problem Description

    Games exported with Node Webkit on Windows seem to freeze every few minutes or so while playing. I have tested this with several different games. Note no freezes occur while playing the game running Node Webkit though Construct 2. This only applies to the exported game.

    Steps to Reproduce Bug

    • Export any game with node webkit and play it for a few minutes.

    Observed Result

    Game will randomly freeze from time to time.

    Operating System and Service Pack

    Windows 7 SP1 64-Bit

    Construct 2 Version ID

    Release 168 (64-bit)

    Edit: Okay it doesn't seem to freeze for some of the example games so I'll include the game file I'm having problems with here: https://dl.dropboxusercontent.com/u/30588726/Not%20Pasu/test.7z

    I wonder if it has something to do with the resolution of the game.

  • Or blocks do not seem to be working properly for me either in the newest version (r144).

    In the Flying along game template, the game does not function properly unless I remove all 'or' blocks. For example the event "Touch|Is in touch -or- Keyboard|Space is down" does not work unless I separate it into two events: "Touch|Is in touch" and "Keyboard|Space is down".

    Edit: Oh there's a r145. Didn't get an email about it for some reason.

    Alright it seems to work fine now!

  • I think the reason is that even though the enemies are leaving the screen, they're still inside the outer margins and only die when they hit the margins. You could either set layout margins to (0,0) or make it so enemies die when they are no longer onscreen instead of leaving the layout.

  • No problem. Also if you want to jump back to be more of an even arc, try something like creating a variable at the time you want to jump that is equal to Self.X - StartingX, then move the sprite (that variable)/(number of pixels to move per frame).

  • Suikama

    That's not a bad suggestion with the families. I'm going to try and alter this idea a bit.

    And you're right, the "Set angle of gravity" does exist for the PLATFORM behaviour, but I need it for the PHYSICS behaviour.

    But thanks for your input, it's always appreciated.You can use both physics and platform behaviors at the same time though. Just have platform apply to the family and physics apply to each object individually.

  • Here's an example of how I've implemented this in my own games:

    dl.dropboxusercontent.com/u/30588726/Not%20Pasu/jumptiming.capx

  • "Set angle of gravity" does exist though

    Unless you mean in general, in which case what you can do is create a family of all the objects you want gravity to be applied to, and then set the angle of gravity of that family.

    Edit: ah I miss read you the first time. However what you could do is make a family then apply the platform behavior to everything and turn off player control.

    Edit2: or not because you cant control platform behavior of families haha silly me

    Edit3: oh hold on, so apparently you can apply behaviors to the families themselves.

    So what you can try is put everything you want to change gravity of into a family. Apply the platform behavior with default controls turned off to that family. Then add an event that sets the angle of gravity of that family. Hopefully that works.

  • just have touch simulate jumping

    so something like:

    Touch| On Touch Any Start: player| Simulate Platform pressing Jump

  • One way you could do it is give your sword a variable, say "hit". Then whenever the sword is swung, if it hits something like an enemy, have events that increase the combo count by 1 and change the "hit" variable to true.

    Then put a condition on said event where it only activates then "hit" is false.

    Finally at the end of the sword animation have an event that changes the "hit" variable back to true. This way the sword can only "hit" something once per swing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright so I applied and was granted Premium access, then I exported my game again, put it on Google Play and this time it let me set up In-App Products. I created a managed product with the same id name as the one I specified in Construct 2. Then I published the game.

    In my game I set up some flags for if CocoonJS can access the store and if it purchases something properly. The first part worked fine and it seems that my game was able to connect to the online store, however upon pressing the "buy" button, my purchase failed flag is triggered.

    My Events in Construct 2 basically goes like this:

    Touch| On touched button: CocoonJS| Purchase product "id" with preview

    CocoonJS| On "id" purchase completed: Text| Set text to "Purchase Completed"

    CocoonJS| On "id" purchase failed: Text| Set text to "Purchase Failed"

    Upon pressing the button, no preview or anything pops up. The text simply displays "Purchase failed"

    Did I miss a step? Or does my id name have to be something more complicated?

  • Ah, I have not signed up for CocoonJS Extensions so I don't have access to that page.

    I'll try signing up for Premium and see if it works.

  • So I created a game, compiled an .apk file with CocoonJS, signed and zipaligned the apk, and put it on the Google Play Store. However I've now run into an issue with trying to get In-App purchases to work.

    In the Google Play Developer Console is states the following in the In-app Products tab for my game:

    "Your app doesn't have any in-app products yet.

    To add in-app products, you need to add the BILLING permission to your APK."

    What I have attempted to do is I opened the original .apk file, added the "IInAppBillingService.aidl" file, and modified the code in "AndroidManifest.xml" by adding the line:

    <uses-permission android:name="com.android.vending.BILLING" />

    Then I resigned/zipaligned the whole thing and tried adding it to Google Play, but Google returned the following error:

    "Your APK cannot be analyzed using 'aapt dump badging'. Error output:

    Failed to run aapt dump badging:

    W/ResourceType(11858): Bad XML block: header size 28257 or total size 1936025193 is larger than data size 339

    ERROR: AndroidManifest.xml is corrupt"

    Has anyone else had any success publishing a game using Construct 2 and CocoonJS with working In-App Purchases and can tell me what I'm missing or did wrong? Thanks.

  • Here's a possible solution for those having flickering problems, namely one that occurs whenever the game changes layout:

    CocoonJS does not support letterbox scaling and if you try it, CocoonJS will default to Scale outer for fullscreen. If you use Scale outer with Construct 2 however, and you do not use the Scroll to behaviour anywhere in your project, then every time the game moves from one layout to another, Construct2 first puts everything in the middle of the screen for the first frame(s), then moves it all to the left side, resulting in a jarring flicker.

    The way to fix this is simply add a Scroll to (0,0) call to the start of each layout.

  • 15 posts