- This topic has 27 replies, 2 voices, and was last updated 2 months, 2 weeks ago by c4cc.
-
AuthorPosts
-
2023-10-24 at 10:21 am #67869c4ccParticipant2023-10-24 at 10:33 am #67870kdvParticipant
Do you understand what’s going on here? Especially the second puzzle…
Puzzles and JS coding. 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 the meaning at all.
2023-10-24 at 1:38 pm #67878c4ccParticipantMy intention was to have the bullet return to the starting point so it could fired again.
2023-10-24 at 1:41 pm #67879kdvParticipantDo you know in how many seconds your fireball will actually return to its initial position? Acorrding to your logic.
Puzzles and JS coding. 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 the meaning at all.
2023-10-24 at 3:12 pm #67880c4ccParticipant1 second. I’m trying to make shots fire with an interval of 1 second per shot.
2023-10-24 at 3:45 pm #67881kdvParticipant1 second
Wrong. 4 seconds in fact.
Puzzles and JS coding. 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 the meaning at all.
2023-10-24 at 4:03 pm #67882c4ccParticipantI 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?
2023-10-24 at 4:12 pm #67883kdvParticipantwithout… 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
andkeyup
event listeners for every key.
Puzzles and JS coding. 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 the meaning at all.
2023-10-24 at 5:09 pm #67885c4ccParticipanthold on…
2023-10-24 at 5:25 pm #67886c4ccParticipantBtw, 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
andkeyup
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 1 year ago by c4cc.
2023-10-24 at 5:41 pm #67888kdvParticipantPuzzles and JS coding. 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 the meaning at all.
2023-10-24 at 6:23 pm #67891c4ccParticipantyour 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:
2023-10-24 at 7:20 pm #67892kdvParticipantMy puzzles:
Puzzles and JS coding. 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 the meaning at all.
2023-10-24 at 8:41 pm #67896c4ccParticipant2023-10-24 at 8:59 pm #67897kdvParticipantYou got exactly what you did
It’s a little bit senseless to place the fireball at the position of the fireball. The fireball is already there.
Puzzles and JS coding. 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 the meaning at all.
-
AuthorPosts
- You must be logged in to reply to this topic.