game-physics

Can't understand how to make character face mouse in PyGame

雨燕双飞 提交于 2020-12-23 12:09:07
问题 Below is what I have so far. At the moment, the player moves, and all I want it to do now is face the mouse cursor at all times (think Hotline Miami or other top-down games). I've used some code involving atan2 that I found online, but I barely understand what it does (finds the distance between the player and mouse somehow...) and my character just spins wildly offscreen until I get an 'Out of memory' error. Any help would be much appreciated, I've looked all over the internet and can't find

Can't understand how to make character face mouse in PyGame

非 Y 不嫁゛ 提交于 2020-12-23 12:08:54
问题 Below is what I have so far. At the moment, the player moves, and all I want it to do now is face the mouse cursor at all times (think Hotline Miami or other top-down games). I've used some code involving atan2 that I found online, but I barely understand what it does (finds the distance between the player and mouse somehow...) and my character just spins wildly offscreen until I get an 'Out of memory' error. Any help would be much appreciated, I've looked all over the internet and can't find

Can't understand how to make character face mouse in PyGame

余生颓废 提交于 2020-12-23 12:07:21
问题 Below is what I have so far. At the moment, the player moves, and all I want it to do now is face the mouse cursor at all times (think Hotline Miami or other top-down games). I've used some code involving atan2 that I found online, but I barely understand what it does (finds the distance between the player and mouse somehow...) and my character just spins wildly offscreen until I get an 'Out of memory' error. Any help would be much appreciated, I've looked all over the internet and can't find

Can't understand how to make character face mouse in PyGame

女生的网名这么多〃 提交于 2020-12-23 12:07:15
问题 Below is what I have so far. At the moment, the player moves, and all I want it to do now is face the mouse cursor at all times (think Hotline Miami or other top-down games). I've used some code involving atan2 that I found online, but I barely understand what it does (finds the distance between the player and mouse somehow...) and my character just spins wildly offscreen until I get an 'Out of memory' error. Any help would be much appreciated, I've looked all over the internet and can't find

Simple drag physics, acting differently when moving left or right [duplicate]

六眼飞鱼酱① 提交于 2020-12-07 06:41:54
问题 This question already has answers here : Pygame doesn't let me use float for rect.move, but I need it (2 answers) How to draw a moving circle in Pygame with a small angle at a low speed and blinking? (1 answer) Closed 13 days ago . My code is acting differently for negative velocities than it is positive ones I'm trying to implement platformer physics, the player has velocity in the X direction, the velocity is increased or decreased when the user presses "A" or "D" respectively, or set to 0

Simple drag physics, acting differently when moving left or right [duplicate]

守給你的承諾、 提交于 2020-12-07 06:40:27
问题 This question already has answers here : Pygame doesn't let me use float for rect.move, but I need it (2 answers) How to draw a moving circle in Pygame with a small angle at a low speed and blinking? (1 answer) Closed 13 days ago . My code is acting differently for negative velocities than it is positive ones I'm trying to implement platformer physics, the player has velocity in the X direction, the velocity is increased or decreased when the user presses "A" or "D" respectively, or set to 0

Simple drag physics, acting differently when moving left or right [duplicate]

风流意气都作罢 提交于 2020-12-07 06:39:04
问题 This question already has answers here : Pygame doesn't let me use float for rect.move, but I need it (2 answers) How to draw a moving circle in Pygame with a small angle at a low speed and blinking? (1 answer) Closed 13 days ago . My code is acting differently for negative velocities than it is positive ones I'm trying to implement platformer physics, the player has velocity in the X direction, the velocity is increased or decreased when the user presses "A" or "D" respectively, or set to 0

JavaScript wall collision on convex shapes, getting stuck at corner

99封情书 提交于 2020-05-09 07:54:27
问题 The bounty expires tomorrow . Answers to this question are eligible for a +50 reputation bounty. bluejayke wants to draw more attention to this question. this is a follow up to this other question: How do I handle player collision with corners of a wall In inspiration of the code given in its answer, I tried to write some new code. Basically, in the original, the wall sliding works very well on the inside of the walls, but I wanted to make it work on the outside as well, so I made a new basic

Efficient collision detection in AS3

时光怂恿深爱的人放手 提交于 2020-04-30 10:58:16
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with

Efficient collision detection in AS3

谁说我不能喝 提交于 2020-04-30 10:57:18
问题 I have a problem with a game that I'm doing. I basically have objects that are in a map and I have to check for each of them if they collide with the walls (and then do something). Since was working with AS2, I thought about doing the same way: I drew a picture with only the walls, so with only rectangles and everything else in between is transparent (does not exist, then the floor for example). In AS2 I put the image to the screen, let's call it wall, and then I did a hitTest to wall with