All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
76 views

Unity 2D launch player towards mouse location

few notes: I'm new to game development I'm not new to developing (1 year of front end web development) I'm trying to get my character to launch towards mouse left click button (which I understood to ...
1
vote
1answer
62 views

Player doesn't move smoothly, when trying to follow position between cursor and player

When my player moves, moving the camera looks like the camera is teleporting to the player, and then after loading teleporting again. I want to make it move smoothly. When the camera is following the ...
0
votes
1answer
101 views

Why does the object not move correctly when I press the right mouse button?

2D Game in UNITY C# I have an object BULLET . After pressing the left mouse on my object (BULLET), the script allows me to rotate object according to the mouse's direction, in four directions : -...
0
votes
1answer
282 views

2D Screen Coordinates to 2D World Coordinates in LWJGL

I'm making a 2d top down game with lwjgl and am having trouble converting my 2d screen coordinates to 2d world coordinates. Here's what I have so far ...
3
votes
0answers
373 views

Why is my 2D mouse aim not working properly?

I'm trying to program 2D mouse aim, where the arms and the gun in the arms rotates to point at the mouse. But for some reason, the arms and gun rotate and do not follow the mouse position. The each ...
4
votes
3answers
5k views

How can I make the player “look” to the mouse direction? (Pygame / 2D)

Here's my code: ...
0
votes
3answers
3k views

Detecting mouse click for the uppermost layered 2d sprite in Unity

I have two sprites. One for the entire background and another small sprite, which is a foreground object. I have written code for both of these objects in their ...
0
votes
1answer
22 views

Wrong object is being detected on OnMouseUpAsButton

In my 2d game project I have an object A moving above map. Both object and map have colliders (circle collider and polygon collider respectively), as well as actions to be performed on ...
2
votes
2answers
305 views

object smooth orbital limit around another object depending on mouse drag

I am working in Unity. I have special objects that can each be dragged freely around in 2d. The objects cannot get too close to other objects (minimal Vector3.distance allowed is 1.5f). I also have ...
2
votes
1answer
132 views

My bullet changes the velocity depending on where I click

I want to build a little 2D-Sidescrolling shooter and I'm now at the shooting script. I already figured out how to shoot a bullet towards my mouse pointer. I got something like this : ...
1
vote
1answer
1k views

Anchoring HingeJoint2D to clicked upon spot

I'm creating a 2D game where the user can click and drag objects around. This is done by connecting a 'Hand' object to the object the user is current clicking on with a HingeJoint2D. Right now it ...
0
votes
1answer
1k views

2D sprite 360 degrees rotation according to the mouse

I am trying to make my top down character rotate according to degrees between its position and the mouse. I'm using this code: ...
1
vote
1answer
632 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates? [closed]

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
1
vote
1answer
88 views

Why does my camera break mouse position targeting? [duplicate]

I made a short video of this. Basically, when the screen scrolls with the camera, the character begins firing at the incorrect mouse position. You can see where I am clicking the whole time. As we ...
2
votes
2answers
1k views

Making mouse pos realtive to a moving object

I'm coding my first actual game, trying without following tutorials, just trying to use my knowledge so far to make something playable. I'm creating (attempting) a simple side-scrolling shooter. I ...
5
votes
1answer
1k views

Scrolling the camera when the mouse cursor gets to the edge of the screen

I was wondering if you could help me: In XNA I have a hexagonal map, and the size of the map currently exceeds the size of the window. There is already code in place to move the 'camera' around the ...