Sorry to bother again. Just have a quick question. I did the event for shooting as so:
CONDITION: z key is pressed
ACTION: do=3 to number of current animation
CONDITION: the timer “gunshot1” is greator to 0.55 seconds
ACTION: play the sound…
reset the timer “gunshot1”
CONDITION: the timer “bullet” is greater to 0.55 seconds
ACTION: create object bullet at position player.PointX(bullet1); player.PointY(bullet1)
add to bullet a force of 900 p/s on X axis and 0 p/s on Y axis
reset the timer “bullet”
Now that works great for shooting when I am standing right. but when the player turns left the bullet
still goes right! I tried to create another event same as above only with a force of -900 thinking it would
then go left, but no, no it did not. Its a platformer game. The automatisin for player is “platformer”
so i am using the default auto controlls. I did all the events for "if jumping change anim if falling and so forth.
I just want him to be able to shoot the zombies on the left aswell! Thank you very much!
It have to work… Negative X values should move the bullets to the left
Could you take a screenshot of the events?
Strange, set -900 instead 900 should move the bullet to the left. I’m testing the action now and works fine
Just curious, if you use the “Add a force (angle)” action with an angle = 180… how works?
Yes my friend it works but then even if the player sprite is “facing” right then the bullet always goes left if i do -900.
I want to figure out how to have the bullet go which ever way the player sprite is facing. if the player is facing right the bullet goes right if the player is facing left, the bullet goes left, that is what i am trying to do.
I hope it is possible.
Thank you for all your help!
It’s possible, of course
You need to add the condition “Horizontally flipped” in the same event you add the force:
Of course you have to place this sub-events under the event where you create the bullet.
If you still have problems with the negative forces:
-You could upload your project and send the link to check it.
-Use forces with angles, angle = 0 in the first event, and angle = 180 in the second one.
wow great! thank you so much! It worked perfectly, but one little problem… When the bullet gets shot and the player turns and shoots again, the old bullet that was shot first as if in the background swings back into the scene. anyway to stop this?
thanks so much. I am really sorry to ask so many questions.
Don’t worry :
Another old bullet is performing the actions for the last one? Seems to be a logic problem, in the image I can see you add the bullet and add forces to it, should not be problem. Can you send me the project to check the problem/s?