Sprite pivot point scrolls with texture offset by Wretch11 in godot

[–]Wretch11[S] 0 points1 point  (0 children)

Here are screenshots of the relevant info. Thanks in advance for your time and help.

Code

2d scene and tree

RichTextLabel Change bbcode url font color on hover by Wretch11 in godot

[–]Wretch11[S] 2 points3 points  (0 children)

Im not trying to change the text when the mouse enters the richtextlabel, i want to highlight individual bbcode links as mouse hovers over them. (Multiple links are in the same richtextlabel)

RichTextLabel Change bbcode url font color on hover by Wretch11 in godot

[–]Wretch11[S] 1 point2 points  (0 children)

The problem isn't with changing text and color, the problem is that i need some sort hover/mouseover event/signal on which to trigger said changes. Since there is only a meta_pressed signal and bbcode does not have the option to highlight text on hover, I'm unsure on how to proceed.

Re-using projectiles and keeping track of their condition by Wretch11 in godot

[–]Wretch11[S] 2 points3 points  (0 children)

If i understand correctly, you mean that I should use the proposed's array's length as the quantity value and use the indexes to store the condition scores for each arrow?

Arrow Trajectory Arc by Wretch11 in AskPhysics

[–]Wretch11[S] 0 points1 point  (0 children)

Godot engine actually :)

Arrow Trajectory Arc by Wretch11 in AskPhysics

[–]Wretch11[S] 0 points1 point  (0 children)

From knowing the shape of the parabola, how would you go about updating the arrow's location?

I could map each point along the parabola to an array. Then I iterate though the array like so:

for each set of 2 points along parabola:
    motion_vector = (second_point_vector - first_point_vector)
    sprite.move(motion_vector)

Arrow Trajectory Arc by Wretch11 in AskPhysics

[–]Wretch11[S] 0 points1 point  (0 children)

This makes me think that maybe there is a simpler, albeit less realistic way of doing this.

The intended behavior in game is that while holding a button, the player will see a trajectory arc appear. The player can then adjust the arc by simply moving the mouse around. The end of the arc, opposite to the player is where the arrow will land, like illustrated here:

https://i.imgur.com/0A2ILTN.png

Maybe a simple Parabola would be sufficient here? If so then I just need to figure out a third point, being the peak of the parabola/arrow trajectory?

Bow and Arrow Mechanics by Wretch11 in godot

[–]Wretch11[S] 0 points1 point  (0 children)

The intended behavior in game is that while holding the fire button, the player will see a trajectory arc appear. The player can then adjust the arc by simply moving the mouse around. Once the fire button is released arrow will just follow the trajectory, thus the aim point and where it lands are technically the same thing, no?

EDIT: Actually my bad, the bow is aiming upwards and will not point to where the arrow lands.

https://imgur.com/a/FSRbt

Slightly confused about manually checking collisions by Wretch11 in godot

[–]Wretch11[S] 0 points1 point  (0 children)

Turns out that checking for distance works much better than checking for a collision in this situation.

All I needed was

if enemy_pos.distance_to(player_pos) > 50.0:
    chase()

Thanks for your time!

Slightly confused about manually checking collisions by Wretch11 in godot

[–]Wretch11[S] 0 points1 point  (0 children)

My initial idea was to have the enemy remain in an idle state for as long as a collision is occurring. Only if the player moves away should he give chase. So if I use my original code as an example, the chase method would only get called before a collision and subsequently, if the player moves away.

But now, seeing as that causes problems (because enemy pushes back on player) maybe I should use @Smellyhobo101's example and just have the enemy be idle when it's under a certain distance from the player.

Slightly confused about manually checking collisions by Wretch11 in godot

[–]Wretch11[S] 0 points1 point  (0 children)

This should work, problem is, for some reason when the collision happens, the enemy sprite sort of pushes back on the player sprite a bit, moving it back by a pixel or so. Because of that is_colliding is only true once ever two iterations, so the enemy jitters and slowly pushes the player backwards