kimtaein1's Forum Posts

  • Is there an event before "On load layout" that i can use to pre-load objects that take a lot of resource?

    I am using AdMob and during loading ad, the game is very slow and doing dt trick doesn't help (the game still lags and there are times when the screen just freezes).

    Because this only happens during ad load, if i could say

    • (in some event) load ad
    • tell construct that it is ready and it should trigger On Load Layout

    if there is no such thing, i will have to add a global variable and all conditions will have to check for it before doing things, but i think there has to be some event beore "On Load Layout" and i just don't know about it.

    thanks

  • i am having the same issue. Without admob loading ad, my game runs at 50fps consistently. When ad loads, it runs between 30~40 fps.

    any optimizations i can do?

  • fixed this by waiting until preload completed event

  • Hi, i am creating ios and android game. Inside the game, i would like to show how i am doing compare to other friends in facebook.

    I imagine i would also need a mechanism for logging onto facebook, get permission through oauth...

    I read https://www.scirra.com/forum/viewtopic.php?f=147&t=129460&p=910820&hilit=facebook+friend#p910820 and it seems like Ribis didn't post his stuff on store.

    Is there plugin or example i can use?

    Thanks

  • anyone?

  • I imported sound effects to sound folder (tried both the highest and lowest quality import) in my construct 2 game.

    it plays nicely on my pc. when i export as cordova, and use phonegap or intel xdk and install on my iphone 6, the sound quality drops significantly. It is as if the sound is distorted.

    What am i doing wrong? The fact that this is happening in both phonegap and xdk says the issue is not with build service but sound files in media folder of cordova export folder are fine when played on my pc.

  • thank you both. the reason i wasn't using cocoon is because https://www.scirra.com/tutorials/303/how-to-export-to-cocoonjs says "Note: when exporting for Android, we recommend using Crosswalk instead since it has better compatibility with Construct 2 games. For more information see How to export to Android with Crosswalk. We also recommend publishing via Cordova for iOS." so it sounds like Scirra want us to use phonegap for ios and crosswalk for android.

    Am i going to have trouble if i use cocoon?

    thanks

  • i used debugger profile and see

    Engine: 58%

    Draw calls: 14%

    Event: 8%

    I understand draw call and events, but what does engine mean?

  • Thanks, my game setup is like this:

    there are prisoners inside a circle. The circle is made up of rocks.

    In the game there are about 100 prisoners and about 240 rocks making up the wall.

    Prisoner has animation: 6 frame, 100x100 pixels each.

    Rock does not have any animation and 44x44 pixels.

    Rock has solid behavior and prisoner has bullet behavior so they constantly move inside the prison but bounce off when they hit the wall. It is crucial that i have about 100 prisoners.

    i tried just using 4 large long rocks for walls, reducing instance count by 240 but the game was still very slow.

    I think the issue is expotential growth of collision check as # of instances grow in the game. I am not sure how i can optimize this. I am using box collider. All my prisoners are in one layer and rocks are in another layer so if i could somehow skip collision check between prisoners and only detect collision between prisoner and wall, i think i can make it faster.

    On my android test device, Galaxy S4, i get about 20 fps and on my iphone, i get about 50 fps.

    I tried phonegap and inel xdk and verified that WebGL is being used.

    Thanks

  • I read https://www.scirra.com/tutorials/298/performance-tips-for-mobile-games and it says i shouldn't have too many sprites, saying more than 20 is too many.

    Did he mean different sprites or different objects using the same sprite?

    My game becomes really slow on iphone 6 when it has more than 100 objects but it needs to have many objects: many units bouncing off of walls and all of them has collision enabled. Walls have collision enabled too so that i can detect when my units are hitting walls (using Solid + Bullet behavior)

    Thanks

  • In the above image, i have center red point and a few circles around it.

    In a repeat loop, every second, i want black circles to move toward the red point until they reach the point.

    After that, i want in a loop, every second move them back to where they were.

    How would i do this?

    One solution that is in my head is

    1. remember black circles' initial position in their local variable

    2. make each circle face the point

    3. each second, slowly move circles toward the point

    4. detect circles touching the point and if yes, face the circle toward its original position (read from local variable)

    5. slowly move toward the original position.

    I think this would work but i have a gut feeling that construct 2 should have something that makes it easier than having to have multiple local variables and 5 actions....

  • I have 2 different colored unicorn, each has 2 direction, left right.

    So I have 4 animation:

    Red unicorn facing Left

    Red unicorn facing Right

    Blue unicorn facing Left

    Blue unicorn facing Right

    I remember my last X position so that i can see which direction the unicorn is moving toward (left or right, ignoring vertical motion).

    See attached.

    I don't understand why but "R_Left" animation is always playing even when unicorn is moving toward right.

    What is wrong with my set up?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a sprite that has 3 animations: Default, Left and Right.

    Left is a unicorn running toward left. Right animation is similar.

    I am stuck on what condition i need to use to detect when the object hit solid and bounce back and therefore change direction.

    I only care about X direction (left, right).

    I disabled Bullet's 'set angle' because the object can move in any direction but i only have left or right animation.

    Things i have tried:

    1. Check the object's angle between -90 and 90 to detect facing right and else for left.. It always think it is facing right...

    2. remember the object's last X. Basically i have 2 'on every tick' event, and on the first one, compare the last X to current X and if the last X is less than current X, i assume it is facing right. in the 2nd 'every tick' event (it is right below the first 'on every tick'), i update the instance's last X variable. Doesn't work for some reason.

    3. Debugger shows that bullet behavior has vector X but i don't know how i can use it in Event sheet.

    There gotta be an easier way to do this...

  • thank you both, using distance to detect border line is really interesting and i might go that route but i am curious is there a way to invert collision polygon? that would be most neat and ideal solution.

    thanks

  • here is what i want to do but don't know how to:

    I created sprite that is just a circle. I only care about its border so both inside and outside of the circle is transparent.

    I added the sprite, and in "edit image" i clicked set collision polygon and later added "solid' behavior to it.

    Now i spawn smaller boxes with bullet behavior that bounce off of solid objects.

    I create them inside the box and set their angle to arbitrary degree.

    At this point, they do not move and i am guessing this is because the collision polygon is set to all areas inside the circle, not just borders. What is the most efficient way of setting up a circular wall so that other objects can move freely inside it?

    Thanks