How could I create a bullet in wick?

What Wick Editor Version are you using?
1.9 test editor

Describe the Problem
I cant seem to create a bullet machanic in wick editor.

What have you tried so far?
Well I wrote this if (isMouseDown()) { this.opacity = 1; this.x = mouseX; this.a = mouseY; } else { this.x = arrow.x; this.y = arrow.y; } I want it so that when you click, it goes half way between the mouse and the arrow. then after a half second i want it to go to the mouse. then after another half second dissapear.

the result you are aiming for isn’t exactly a bullet.

but if that’s what you want, you need to figure out where the bullet is, where the arrow is, and where the mouse is.

  1. if the bullet is in the same position as the arrow, take the average of the x’s of the mouse and arrow. do the same with the y coords. then move the bullet to your averaged position.
  2. else, if the bullet is in the same position as the mouse, remove itself.
  3. else (in the middle), go to the mouse’s x and y.

this method is probably trash because if you move the mouse while this occurs, it might keep going to the new mouseX and mouseY until the mouse stops moving. what you can do to extend on this is to first record the mouseX and mouseY and put them in variables and use the variables instead of the current mouseX and mouseY.

that is true. what would you recommend i do to make a more realistic bullet?

perhaps this will help.

2-person shooter7-25-2020_10-36-23AM.wick (93.0 KB)

i made a clip with a gun on the first frame and a traveling bullet on the next frames. find that in gun1 and gun2.

look at the code in “update” in gun1. it basically says:
2. if the gun is not fired yet, play the animation when “s” is pressed. (in other words, shoot the bullet.)
4. if it touches player 2 while the gun is in its “shooting” animation (not the first frame), take away a life from player 2.

How would I add this to my game? The circle is the object your move.
the bullet is what i want to shoot.My Project12-31-2020_14-33-39.wick (63.4 KB)

your game at first glance looks like it’s kind of like mine, but it’s one player and it’s top-down. i don’t have time right now to help you, but maybe i can help later.

if you really want to, you can attempt to reskin and recode my file to make it what you need.

i may do that.