3
votes
Area2D only detecting body_exited once
The ball being an static body is odd... I suspect the Area2D is not detecting the static body at all, see the issue: Area2D does not detect moving StaticBody2D.
I ...
3
votes
Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner
It appears that your code is fighting with the physics engine about who gets to control the velocity vectors of the balls.
When there is a collision between two rigidbodies, then the Unity physics ...
3
votes
Fast way to calculate angular intervals and occlusion of circular objects in a 2D vision cone
Here are some optimization suggestions:
1. Filter unnecessary tests
Objects located outside the field of view circle(distance>r1+r2) do not need to be detected. ...
3
votes
Rotating 2D sprite around tilted Y axis
I think this would be easiest using SKTransformNode.setQuaternion instead.
This makes it easy to express a rotation by some angle around any axis you choose, rather than only rotations around the ...
2
votes
Accepted
Rotating 2D sprite around tilted Y axis
Try creating the art so that the red line is horizontal, then rotate it in Swift on its zRotation, and animate scaling along the ...
2
votes
Accepted
How to make redirected player movement respond to same key?
Not tested, but you could try looking at which keys the player is pressing when they're warping and setting the velocity x/y values to 0 when they're released depending on how much the movement is ...
2
votes
Why won't my bullets shoot?
It should have been .up instead of forward, because forward is for 3D. Then *-1 because I want it to go in the opposite direction.
2
votes
Why is my enemy in unity 2d not moving?
Use formatted text instead of an image.
In the OnEnable() and OnDisable() functions, you used ...
1
vote
Accepted
Simulated light for a 2D tile-map with just SDL2?
I think what you want is to create a black texture with the same size as your screen, set it as the render target, render blurry white circles to it at the locations of the light sources, with the ...
1
vote
Accepted
Optimal Approach for Transmitting and Rendering Large Pixel Art Game Maps in Unity
What I would suggest in this case is the following:
Rendering details like pixel colour, are usually not crucial to game logic. Since you will need to render the 1000x1000 map as a texture, it is ...
1
vote
Accepted
Sprite chasing a target using move_towards_ip does not move
pygame.sprite.Group.draw:
Draws the contained Sprites to the Surface argument. This uses the Sprite.image attribute for the source surface, and Sprite.rect for the position.
So we need to update ...
1
vote
Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner
These issues can be solved by calculating the average normal, instead of the first collision normal.
...
1
vote
Fast way to calculate angular intervals and occlusion of circular objects in a 2D vision cone
My first move would be to use a Raycast at regular intervals between the start & end angles. In other words:
begin at the starting angle
perform a raycast ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
2d × 3485unity × 1099
c# × 467
collision-detection × 370
physics × 346
java × 297
sprites × 265
xna × 260
c++ × 166
animation × 165
movement × 160
mathematics × 147
opengl × 140
tilemap × 133
3d × 132
platformer × 129
tiles × 125
android × 120
camera × 115
javascript × 113
graphics × 105
libgdx × 98
rotation × 97
algorithm × 91
lighting × 83