Turret rotation issue

Just started using Construct 2? Post your questions here

Post » Mon Dec 08, 2014 9:50 am

Hy guys, i'm a begginer in Construct 2, and I really need one little help :mrgreen:

I'm doing a game with simple tank, and a objective is to destroy a building.

I made point n click movement for tank, fireing bullets, turret is pined to tank, turret have rottate up and down, when bullet touch building bullet is destroyed, and make a some force to building etc...

But I have little problem, in turret rotation :) How can I make that left side of turret have fix position to tank, and when I press up or down - only right side of turret have rotate?

In picture you can see my problem :D
I'm using free edition of C2.

Thanks!
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 8
Reputation: 218

Post » Mon Dec 08, 2014 12:02 pm

Pin to "PostoljeTopa" position only ?
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Mon Dec 08, 2014 12:32 pm

This condition is already set to game. "PostoljeTopa" is a tank base, "Top" is turret of tank.

Now when I press up or down - turret rotates arround his center, but I want that turret rotates arround left side of turret.

Here is another picture of this problem :)

Here is example when I shoot "down".

First picture is like I want to be, left side of turret pin to tank base, so when I rottate turret, it rotates arround left side of turret, and pined to tank base.

Second picture is what is problem now.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 8
Reputation: 218

Post » Mon Dec 08, 2014 12:38 pm

set origin point... (For "Top")
You do not have the required permissions to view the files attached to this post.
Last edited by korbaach on Mon Dec 08, 2014 2:56 pm, edited 1 time in total.
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Mon Dec 08, 2014 1:32 pm

I will try with this, tnx!
B
4
Posts: 8
Reputation: 218

Post » Mon Dec 08, 2014 7:34 pm

It works, tnx !!

Does anyone knows how to add a compare value that compares something like "is the mouse cursor in front of turret"?

With this I will avoid that turret can not fire behind himself :D , just in front of his angle.

Like: mouse.X >= turret toward angle.

I was look at every example and look in manual, but can't figured out.
B
4
Posts: 8
Reputation: 218


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests