Problem with bullet behavior

Discussion and feedback on Construct 2

Post » Thu Jun 11, 2015 11:09 pm

I've a problem to use a bullet angle motion action. Something is wrong. I don't know if it's a bug, so I'm posting it here.

I used a variable to store a random angle and I noticed that the sprite always moves horizontally (0 or 180), never vertically. So, I tried to put an angle value directly instead of using a random angle and the sprite maintain the same directions.

The respective part of my script:

Image

Thanks in advance for any help.
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Fri Jun 12, 2015 3:29 am

can you duplicate it in a small capx and post it?

the bullet behavior is pretty bullet proof, no pun intended.. sounds like you are just overlooking something easy..

do you have "set angle Yes" in your behavior properties?
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Fri Jun 12, 2015 6:02 pm

Hi @jobel

Sorry about the CAPX. I always uploaded a project but in this case it's not possible. The project is quite large.

I'm glad do hear that bullet behavior is okay, but I don't understand how the direction moves only horizontally when I defined a absolute angle. I tried inclusive to set the angle to 45 degrees, directly in the action, and nothing changed.

The "set angle" option is "No". I'll review the script again. Who knows ....

Thanks
B
74
S
13
G
3
Posts: 995
Reputation: 7,531

Post » Fri Jun 12, 2015 6:04 pm

I think you have to set the speed first, then the angle, as with a speed of 0 the angle of motion won't be changed (as there is no motion..)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Fri Jun 12, 2015 6:18 pm

the mistake is that u used choose (0,180,90,270) in which case choose will automatically choose from left to right one of those variations, however if you'd be adding choose(0,180,90,270,0,180,90,270,0,180,90,270) wold increase the chances for the choose function to actually pick 270 or 90 ! atleast that's how i make it in order to avoid creating repeat N times functions.

however the system seems to kinda like the pare numbers as in 0,2,4,6,8,.......180....... and so on so it will automatically most of times choose 0 or 180
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301

Post » Fri Jun 12, 2015 6:42 pm

Aphrodite wrote:I think you have to set the speed first, then the angle, as with a speed of 0 the angle of motion won't be changed (as there is no motion..)


@Aphrodite

You're awesome! Thank you very much! (I'm not French, but I make a point: Merci beaucoup)
B
74
S
13
G
3
Posts: 995
Reputation: 7,531


Return to Construct 2 General

Who is online

Users browsing this forum: Cliffu and 3 guests