Shooting from character?

Just wondering how to make a character to shoot an object.

3 Likes

When a button is pressed? At a random time?

Do something like:
On (button press, after X time), do clone object (bullet).
Object (bullet) move towards (player?)
If bullet hit player, end game

Or something similar :smiley:

3 Likes

Hi @AlexArrow !, maybe this topic can help you: Bullet behaviour angle not rotating when firing - #4 by greenreader9

3 Likes

If you want to shoot a bullet upon clicking a trigger, then you can do:

If you want to shoot a bullet upon pressing a key (let’s assume “S”), then you can do:

1 Like

Thanks and sorry for not being more detailed.

Essentially, I want the character, who is in a platformer/side scroller with left/right/jump controls, to fire an object in the direction of where the screen was clicked/tapped.

Is there a tutorial or the like to learn how to use ReadyMaker?

2 Likes

A way to achieve something like you wants to do is,

Place a large transparent rectangle as your background.
Place a ball to always set position to your character when a variable is 0.
When rectangle senses touchdown, do variable set to 1.
When variable =1, do ball set position to last touch coordinates.
Do variable set to 2.
When variable = 2, do character, clone bullet sprite. Do variable set to 3.
When bullet clone senses touching-character and variable = 3, do bullet clone face ball, do apply force etc, do variable set to 4.

When bullet collides with enemy or screen edge, do variable set to 0.
Do bullet clone, destroy clone.

I haven’t used Ready for a while and i’m a little rusty.
I hope this helps, there’s probably better ways to do this.

3 Likes

You can add two circles (from the Assets Library > Basic Shapes) and rename them as “Shooter” and “Shoot Direction”. You can adjust the size if you want. Then add the following events:

Let me know if it works :slightly_smiling_face:

3 Likes