bullet behavior: SET ANGLE

Get help using Construct 2

Post » Tue Apr 14, 2015 3:11 am

hello everyone,

i have a quick question (looked everywhere and could not find an answer).

the bullet behavior has a SET ANGLE property ("If set to No, the behavior will never change the object's angle. If set to Yes, the behavior always sets the object angle to the angle of motion.")

is there any way to set this property at run time via events? i can change it easily in the properties window when developing, but wanted to know how to change the value dynamically while the game is running.

any thoughts?
B
114
S
31
G
8
Posts: 123
Reputation: 11,102

Post » Tue Apr 14, 2015 8:35 am

You can always set the angle of the sprite in events, so you could also choose to set the angle of the sprite to be the same as the angle of the bullet motion through events.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Apr 16, 2015 2:36 am

i have done that, and that's how i want the sprite to behave in normal circumstances (ie, normal times the sprites angle is set to the angel of motion)...however, there are times when i want to disable that functionality so that the sprite is facing one direction and going another direction...and in those circumstances the sprite should not be the same as the angle of motion. you can set the angle property value to yes|no during the development drop-down menu...but cannot find a way to do so dynamically, via events.

any help you can provide will be GREATLY appreciated.

thanks.
B
114
S
31
G
8
Posts: 123
Reputation: 11,102

Post » Thu Apr 16, 2015 8:37 am

You could just do this by specifying when the angle should be different and what you want the angle to be.

in normal circumstances:

every tick set bullet angle - sprite.bullet.angleofmotion

mouse button left is down - sprite set angle towards position mouse.x, mouse.y
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: celstrider, cgsammu, jpstudio, justifun, LaurenceBedford, Magistross, varr and 11 guests