We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Create shooting action with puzzles?

Home Forums Puzzles Create shooting action with puzzles?

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #67869
    c4cc
    Participant

    I wanna create a shooting action.
    My puzzles:
    original-drawn-by-nanashinayuzu-mochi-53d2788a0d5e217f8b28d256c728bf04

    Unfortunately, the 2nd and third shots lag in mid air, and I can only wait a couple seconds before I can fire shots as intended.

    #67870
    kdv
    Participant

    Do you understand what’s going on here? Especially the second puzzle…

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67878
    c4cc
    Participant

    My intention was to have the bullet return to the starting point so it could fired again.

    #67879
    kdv
    Participant

    Do you know in how many seconds your fireball will actually return to its initial position? Acorrding to your logic.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67880
    c4cc
    Participant

    1 second. I’m trying to make shots fire with an interval of 1 second per shot.

    #67881
    kdv
    Participant

    1 second

    Wrong. 4 seconds in fact.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67882
    c4cc
    Participant

    I see now why, because of this duration 2, thus adding 3 extra seconds to the fireball. Now, how do I get the shot fired in a straight line without it lagging or going up or down whenever the character does so?

    #67883
    kdv
    Participant

    without… going up or down whenever the character does so?

    your fireball is parented to the object which is moved by keys. but it should be independent to move in global coordinates. think. you should clearly understand the difference between global/parent/local coordinates…

    Btw, it’s a bad approach to use duplicate code. You already have the event listener puzzles added, there is no need to add the keydown and keyup event listeners for every key.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67885
    c4cc
    Participant

    hold on…

    #67886
    c4cc
    Participant

    Btw, it’s a bad approach to use duplicate code. You already have the event listener puzzles added, there is no need to add the keydown and keyup event listeners for every key.

    Um, is this directed at me, or someone else? Doesn’t seem to fit in here, as these are running puzzles, not shooting

    • This reply was modified 6 months, 1 week ago by c4cc.
    #67888
    kdv
    Participant

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67891
    c4cc
    Participant

    your fireball is parented to the object which is moved by keys. but it should be independent to move in global coordinates. think. you should clearly understand the difference between global/parent/local coordinates…

    Yes, character can now move away as fireball moves a fixed distance. Unfortunately, I press the shoot button, and the fireball fires from its last position. How do I shoot a new fireball, instead of making the previous fireball continue another distance.

    I unparented my fireball using this:
    original-drawn-by-nanashinayuzu-mochi-53d2788a0d5e217f8b28d256c728bf04

    My puzzles:
    original-drawn-by-nanashinayuzu-mochi-53d2788a0d5e217f8b28d256c728bf04

    #67892
    kdv
    Participant

    My puzzles:

    :wacko: :cry:

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #67896
    c4cc
    Participant

    Unfortunately, it’s not working, fireball is fired only from a specific place, not from the character’s certain place itself when it moved around. Also, unfortunately, fireball “resumes journey” when shoot button is pressed, instead of a new fireball coming out from character’s certain place.

    original-drawn-by-nanashinayuzu-mochi-53d2788a0d5e217f8b28d256c728bf04

    #67897
    kdv
    Participant

    You got exactly what you did :unsure:

    It’s a little bit senseless to place the fireball at the position of the fireball. The fireball is already there.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

Viewing 15 posts - 1 through 15 (of 27 total)
  • You must be logged in to reply to this topic.