change angle question

Get help using Construct 2

Post » Sun Oct 09, 2011 7:38 am

how do i get an object to change its angular direction once it reaches a specific point on screen.

(example)
i have an object that starts off moving at a 45 degree angle; when it reaches the right side of the screen, i want it to change its angle and move to the opposite side of the screen (kind of a zig-zag type motion down the screen)

(solutions i have tried)
1. i tried assigning the object 8 direction movement and using the "reverse" direction = nothing

2. i've tried comparing the X position on screen and set a new angle approach = nada again...it simply reaches the X position and moves down the screen in a straight line

3. i've even tried destroying the object once it reaches the desired X position and spawning a new 1 in the exact location and assigning a new desired angle = ziltch

any suggestions?
B
16
S
2
G
1
Posts: 43
Reputation: 1,473

Post » Sun Oct 09, 2011 11:20 am

http://dl.dropbox.com/u/36472942/construct/forumhelp/Sprite-MoveForward-Angles.capx
This capx works for N2 solution.

As long as you simulate a "press right" for the 8dir behavior, your sprite will go right, whatever its angle is.
The solution there is the action "move forward".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon Oct 10, 2011 6:09 am

thanx kyatric #2 works, i was forgetting the "move forward" action
B
16
S
2
G
1
Posts: 43
Reputation: 1,473


Return to How do I....?

Who is online

Users browsing this forum: mercuryus, Yahoo [Bot] and 17 guests