game-physics

Brick Collision Java [closed]

时间秒杀一切 提交于 2019-12-10 20:55:26
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I have been working on a Breakout game and have just about everything done except for the brick collision. The ball bounces of the wall and paddle fine, but when it comes to the brick it goes straight through them. I'm pretty sure the problem is in the checkBrick() part of the

SpriteKit score is acting randomly

梦想的初衷 提交于 2019-12-10 17:39:44
问题 I am creating a game with SpriteKit and attempting to increase the score upon a collision. For some odd reason every time the score increase it is by a random number not just 1. In the didBeginContact method I have a collision between a bullet and an alien. Every time the collide I would like the score to increase the score by 1. Except it has a mind of it's own and will randomly increase it by a number between 1 - 6. I have been through every line of code and have attempted to add scoring

Detecting current rotation with Paper.js

六月ゝ 毕业季﹏ 提交于 2019-12-10 16:45:16
问题 I'm making a small shoot 'em up game with Paper.js, but I'm unable to find that Paperscript provides any way to get the current rotation of my group of items. In the code beneath, rotating 'circlegroup' with Q and E keys, should affect the WASD navigation, moving the item in the direction that the 'nose' of the object is currently pointing at. I figure that I need to get the current rotation of my items in order to affect the navigation. Does Paper.js provide any way to do this? You can see

2D soft bodies: Gelly and moldable?

狂风中的少年 提交于 2019-12-10 12:31:25
问题 I am using Matter.js physics in an attempt to create soft bodies. I was able to create a body like this: However I am not sure if this is the "soft body" I want. It is true that this body is not entirely rigid and has that bouncy feel when it collides and gets dragged. I was looking for a body that shares similarities with a gelly. This image might visually help explaining the concept: I was wondering how these type of bodies can be made. Is it the same as the as matter.js soft body but with

Does Box2D Physics rely on the framerate?

末鹿安然 提交于 2019-12-10 10:48:03
问题 I am making a 2D sidescroller game for Android and am thinking of using Box2D for the physics. I would like to know if when using Box2D, if the framerate of the device drops from 60 fps (Android's cap) to, for example, 30 fps will all the physics slow down with it? To elaborate, I'm going to be using real-time online multiplayer and so the framerate cannot be relied upon as a constant. So if one of the devices in the multiplayer game is running at 60 fps and another is at 30 fps and an object

Inheriting from Transformable and Drawable in SFML

可紊 提交于 2019-12-10 04:29:35
问题 I'm trying to inherit from Transformable and Drawable in SFML in order to make my objects... well, transformable and drawable. I'm making a simple breakout game, but perhaps I'm going about this the wrong way. Here's my code: #include <SFML/Graphics.hpp> #include <SFML/System.hpp> class Player : public sf::Transformable, public sf::Drawable { public: Player(int x, int y); ~Player() {}; sf::RectangleShape p_rect; void doMovement(const sf::RenderWindow& window); sf::FloatRect getGlobalBounds()

Multiplayer billiards game physics simulation [closed]

可紊 提交于 2019-12-09 23:58:20
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I’m building an online multiplayer billiards game and I’m struggling to think of the best approach to multiplayer physics simulation.

Spinning a prize wheel with touchesMoved in SpriteKit

拜拜、爱过 提交于 2019-12-09 18:36:27
问题 is it possible to use applyAngularImpulse but not exponentially increase the speed of the wheel? Ideally I'd like to have the wheel follow my finger, but setting node.zRotation += atan2f(y2-y1, x2-x1) spins my wheel out of control. here's what i settled on, but it feels pretty wonky: - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; SKNode *node = [self nodeAtPoint:location]; CGPoint positionInScene = [touch locationInNode:self]; CGPoint

AABB collision resolution slipping sides

ⅰ亾dé卋堺 提交于 2019-12-08 17:33:59
问题 So, I am currently reinventing the wheel (and learning a lot) by trying my hand at making a simple physics engine for my game engine. I have been searching the internet, trying (and failing) to fix my current problem. There are a lot of resources out there on the subject, but none of those that I have found seem to apply to my case. THE PROBLEM IN SHORT: The collision resolution does not work as intended on some of the corners when two rectangles are colliding. How it fails varies based on

Algorithm 3d orbiting camera control with mouse drag

匆匆过客 提交于 2019-12-08 13:57:44
Please help, I couldn't find detailed explanation about this which is not language specific and not library dependent, because I want to control the math myself for some reason. How to create orbiting camera control with mouse, like middle-click drag in Google SketchUp ? * In Google SketchUp, the camera can move circularly orbiting imaginary object in the middle of the plane ( not always 0,0,0) by dragging the mouse. It can orbit horizontally, vertically, even diagonally, all directions. The simplest solution is to store X/Y direction angles and eventually a zoom level. Then, you modify the