Colludium's Recent Forum Activity

  • Hi lucid,

    I have a quick plugin question / request for you.

    I'm trying to manage my player object / spriter animation between layouts. Inside Layout 1 a non-global spriter object is created and this is destroyed at the end of the layout (by C2, not by my events). When the spriter object is then created at the start of Layout 2, the same On Initialised trigger (shared event sheet with Layout 1) is not firing. My work-around presently is to set a timer and keep my fingers crossed that the time delay will be adequate.... Would it be possible to have an Is Initialised status check event so that this can be checked on each layout with a trigger once? Or is this a bug? I expected that the creation of a new instance would trigger the On Initialised event.... Thanks!!

  • !! 100 releases !!

    I am a little disappointed in the physics engine in C2 because the rest of the game engine is simply brilliant. But stuff like this makes game making using physics quite frustrating (and impossible).

  • ^^ as above - painfully slow on Nexus 5 running Chrome, even over wifi, small and ambiguous links don't help the experience either. It's great on laptop, though...

  • The same thing happens if you use a Timer to change the frame back to 0, so the problem is something associated with fast moving / dynamic physics objects changing their joint reference positions when they change frame (I think...).

    codah, if you create another head sprite (non-physics) and pin it to the head physics object (make it invisible) then you can then change the image frame on the visible sprite for the effect you're after.

  • There are some good lessons in this thread. Hope this helps fix your snag...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could you post a capx example so we can have a look? It's hard to guess what might be the cause otherwise.

  • It would be somewhat ironic if the future of gaming is html5 but the future of forums requires an app... A mobile optimised forum would get my vote!

  • There is an alternative method. If you make your object Cage a global object then it won't get destroyed between layouts... You could store your ammo/weapon data inside its instance variables, which you might find easier to visualise in the event system because they are all drop down items. Just keep it invisible / on layer 0 / no collisions etc so it doesn't interfere with the game during runtime. I've just started using global objects with variables for things like score, energy, player mode FSM and the game FSM - I find it much easier to work with in C2 than the dictionary object.

  • Fimbul,

    Thanks for point out the poor logic and bad public maths on my part - the equation elements are the wrong way around!! That's what happens when you use your phone (poor excuse) for writing equations.

    I've edited the original post and put the numerator and denominator the correct way around.

    Edit: The idea with using sin is because sin(0) and sin(180) return zero - which should correspond to the top and bottom of the hill, whilst sin(90) which is the middle of the hill slope will return a 1 (max force factor value).

  • To add onto your idea, I would use some maths so that the force on the ball will be at a maximum 1/2 way up the slope with no force on top and no force at the bottom of the slope (simulating a varying gradient). Something like:

    Force = ForceFactorVariable * sin( 180 * distance(ball.x, ball.y, hill.x, hill.y) / (hill.width * 0.5) ) **

    ForceFactorVariable could be the mass of the ball x some other factor to get it to look right or to allow you to change the height of the hill. I would also add a check to correct Force to zero if Force < 0 , just in case the combination of collision polygon and distance measurement cause a negative value to be returned (that could happen in a corner of a square hill sprite, for example).

    Hope this makes sense....

    **edited for some bad public maths!!

  • Since it doesn't happen in debug, try adding a debug text of your own to the HUD to show the number of / position of and z layer of that object group. It might be being drawn but underneath the backdrop...

  • Does it happen in all browsers and node preview? I would also try and clear out the browser's cache, just in case...

    Having said that, I have seen only a couple of examples of this myself over the last year - all weird z axis problems that I couldn't figure out. After a frustrated attempt to fix by other means I just resorted to forcing the z order of the objects in question every tick to ensure that they were drawn in the right place...

Colludium's avatar

Colludium

Member since 26 Aug, 2013

Twitter
Colludium has 11 followers

Connect with Colludium

Trophy Case

  • 11-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
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies