How do I make parameter change effective

Just started using Construct 2? Post your questions here

Post » Fri May 09, 2014 5:57 am

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 :
Parameter change.jpg

With the layout:
Gravity extract.jpg

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
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 5
Reputation: 401

Post » Mon May 12, 2014 3:25 am

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)
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Sun May 18, 2014 3:16 pm

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.
B
5
S
1
Posts: 5
Reputation: 401

Post » Tue May 20, 2014 12:42 pm

Image
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.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests