[solved] set bullet angle of motion toward window center

Get help using Construct 2

Post » Tue Oct 25, 2016 3:18 pm

I'm trying to get an object to spawn at the player's position (got that) and move toward the windows center regardless of the players co-ordinates at the time the object spawns.

I've tried many variations of bullet - set angle of motion > windowwidth/2, windowheight/2 but C2 won't let me use any of those.


Thank you for any input on this matter.
Last edited by jeffige on Tue Oct 25, 2016 6:35 pm, edited 1 time in total.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Tue Oct 25, 2016 4:22 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Oct 25, 2016 4:31 pm

Use OriginalWindowWidth / 2 instead. WindowWidth is your current monitor resolution, not your in-game resolution.

Image
B
14
S
2
Posts: 35
Reputation: 789

Post » Tue Oct 25, 2016 5:24 pm

Thanks for the replies.

It took a lot of trial and error but i got it...finally - angle(X2_135.X, X2_135.Y, LayoutWidth/2, LayoutHeight/2)


Although i read posts, tutorials, watch videos, it takes me a bit of time to comprehend things. That's just how my brain works. Sorry i'm not as quick as some of you guys.


Again, thanks for the help. Very much appreciated.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly, tarek2 and 18 guests