How do I make parameter change effective

0 favourites
  • 4 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Hi everyone!

    I have a newbie question but it is because it makes no sense to me why my code is not working. I want to make a gravity-based game. After different attempts (I posted a question in the "How to make a gravity-based game" tutorial, page 4, without answer yet), I am trying something. Anyway, my problem is that my parameter changes do not always seem to be effective, I need to understand why.

    So, here is my code :

    [attachment=1:m42pd5pa][/attachment:m42pd5pa]

    With the layout:

    [attachment=0:m42pd5pa][/attachment:m42pd5pa]

    Could someone explain me why my ClémentBox is not rotating when it is overlapping my object Passerelle?

    Thank you in advance for any help you could give me.

    Winsclav

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:2zgfr3l6]Could someone explain me why my ClémentBox is not rotating when it is overlapping my object Passerelle?

    Thank you in advance for any help you could give me.

    Are you certain that it doesn't rotate? it seems to be rotating Angle + 180 degree 60 times a second, so are you sure that it just doesn't rotate so fast that you think its not rotating, try to run it in the debugger and see if its angle changes there. Otherwise there must be some other code that mess with the rotation, that are not in the screenshot.

    Maybe its the angle one in the every ticks that screws it up, try to disable that. (The last line)

  • Hi nimos100, thanks for your reply.

    I don't understand why you write that my player turns 60 times a second. It's rotating clockwise, from left to right, like a clock... Did I miss something?

    When I check the parameters changes with the debugger, I see that my variable "gravity_angle" is only changing when touching the other gravity zone, not before (my "Passerelle" event is useless).

    If I disable my last toggle, my player falls (because it is not attracted by my planet).

    I made no success on this direction.

    Finally, I make my player jumps just enough to touch softly the other gravity zone, making the rebound not visible. And I don't need any "passerelle" anymore...

    But still, I don't understand why my event is ineffective.

  • [quote:232ikl5k]

    I don't understand why you write that my player turns 60 times a second. It's rotating clockwise, from left to right, like a clock... Did I miss something?

    When I check the parameters changes with the debugger, I see that my variable "gravity_angle" is only changing when touching the other gravity zone, not before (my "Passerelle" event is useless).

    In the first highlighted area, Clementbox is overlapping Passerelle, it will run 60 times each second as long as this is true. And it will rotate Gravity_angle + 180 degree clockwise.

    In the next one you will again 60 times a sec, Set the angle of Clement to the angle of ClementBox.Angle.

    And then you set the Clementbox Platform angle of gravity to Gravity_angle degree.

    It seems to me that there are some conditions that might conflict with each other. But im not really sure, it just seems a bit weird to me.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)