Xionor's Forum Posts

  • Link to .capx file (required!):

    https://dl.dropboxusercontent.com/s/2e50axs10iflc0c/PreventRotations.capx?token_hash=AAGjpq9kGp7szmhPN0RpPv6bfgy-Gp3bz3-fRvc907y6Hg&dl=1

    Steps to reproduce:

    1. Give an object Physics behavior.

    2. Click Object and put Prevent Rotations to "No".

    3. Create a condition, for example, "On start of Layout"

    4. Create Action : Turn ON "Prevent Rotations" via: Object> Physics> Prevent Rotations

    Steps to reproduce 2(Alternative method):

    1. Give an object Physics behavior.

    2. Click Object and put Prevent Rotations to "Yes".

    3. Create a condition, for example, "On start of Layout"

    4. Create Action : Turn OFF "Prevent Rotations" via: Object> Physics> Prevent Rotations

    Steps to reproduce 3(Alternative method):

    1. Give an object Physics behavior.

    2. Click Object and put Prevent Rotations to "No".

    3. Create a condition "On Toched Object"

    4. Create Action : Turn ON "Prevent Rotations" via: Object> Physics> Prevent Rotations

    Observed result:

    CocoonJS locks up/crashes when trying to switch rotation states.

    Accelarated CocoonJS Physics - Game locks up with massive screen flicker or just locks up.

    Web-based CocoonJS Physics - Black screen.

    Error console gives a lengthy error message, including most notably:

    "Object[object Object] has no method 'SetFixedRotation'

    at Acts.SetPreventRotate(Physics_Behavior.js:14124:13)"

    Expected result:

    The game runs.

    Browsers affected:

    CocoonJS 1.4

    Operating system & service pack:

    CocoonJS 1.4 and Android 4.1.2

    Construct 2 version:

    R139

    Will report this to Ludei as well.

  • I guess you could always compare position (Y coordinate) with ground instead of checking "on collision with ground".

    The center of the Y coordinate is in the Origin Point of the object, which is in the middle. Since both object and ground are solid objects, they never cross.

    In addition, the ground has different heights.

  • The "Black Box" solution worked, but it's not really straightforward. Still looking for suggestions : )

  • Hey,

    I'm making something simple with the Physics behavior. If the object hits the ground at too high speed, it's destroyed. Code looks like this.

    ->On Object Collision with Ground

    --->If Object Overall Velocity > 400 : Destroy Object.

    The object always hits the ground with 500 Velocity.

    In 50% of the cases, the object is destroyed on impact.

    In 50% of the cases however, the object is NOT destroyed.

    What I imagine is that sometimes, at the moment of collision the object's velocity gets reduced BEFORE the game can check for overall velocity on the next tick.

    Any idea how to go around this inconsistency?

    I suppose I can record the velocity in the last few ticks in an Array, like a black box, and check the last few entries from the moment before impact, but that seems quite cumbersome for a simple check.

  • You mean this game? :)

    http://ludei.com/games/sumon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're setting the angular velocity and applying a force every single tick - that's to say about 60 times a second.

    That's both on "Is clicked" and "Else". The PC probably manages the load while i suspect a mobile phone probably can't handle it that well.

    Also, are you using CocoonJS to port the game to Native first? Physics are extremely CPU consuming. CocoonJS uses an accelerated physics engine which increase FPS a lot on mobiles.

    Try to rework the events - maybe make them triggered?

    Like,

    On Left Button Clicked on Shape
    [ul]
    	[li]>if Clicked = 0 -> Apply Force/Velocity, Set clicked to 1.[/li]
    	[li]>if Clicked = 1 -> Remove Velocity, Set clicked to 0.

    Another variant would be

    On Left Button Clicked on Shape
    [ul]
    	[li]>if Clicked = 0 -> Set Velocity, Set clicked to 1.[/li]
    	[li]>if Clicked = 1 -> Remove Velocity, Set clicked to 0.[/li]
    [/ul]
    While Clicked = 0 -> Apply Force

    The first variant applies the force only once, whereas the second applies it every tick.

    Try those 2 and tell us if they work better.

    (BTW) Applying 0 force to an object does absolutely nothing at all, so no point in using that.

  • Try using only Mouse.X or Mouse.X("layer") ?

    See if any of those 2 work better with your game : )

  • Are you trying to copy someone's game? ^^

  • Make 2 Sub-Events under "On Colission with enemy".

    One for "Player is mirrored"

    One for "Player is not mirrored"

    Put the same code in both of them, just change the Physics thing for each : )

  • What if your path zig-zags tho or goes around a lot?

    You should't need to "trick" or "force" the behavior into doing something it should be doing by default. It really looks like there's a bug/oversight with it.

  • So THAT'S what's happening.

    I have the same problem. Going forward, the object follows the path immediately.

    But when I order it to go back, it takes 2-3 seconds before it starts moving. I've DISABLED rotation, so this would explain what's happening - that it takes 2-3 seconds to rotate backwards(in the game code, but not visually) before it moves off.

    I hope this can get fixed.

    Ashley - Is this a bug or is it intended functionality?

  • Ashley - On mobile devices, even one-time changes/updates to the Text object induce a small hickup/stutter. Hence why I recommend to avoid it altogether.

  • People are willing to fund anything on Kickstarter as long as it's good enough, doesn't matter what it is or how it's made.

    Do have in mind though, those that have gotten funded millions are professional and experienced game studios, not startup developers : )

  • You shouldn't use the Text object with WebGL. It's VERY performance heavy, especially on mobile devices. Rather use Sprite Fonts.

  • I see your "Reset Layout" is disabled. You need to reset it for the timer to restart.

    Which version are you using?

    I remember the previous versions had an issue where "Every X seconds" timer would not reset, even after layout reset, so that it would execute again the first moment it's available.

    I believe that's why Ashley added the Timer behaviour instead, try to use that.