Questions tagged [game-physics]

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or 3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

3864 questions
1
vote
3 answers

How to know whether an SKSpriteNode is not in motion or stopped?

In my game, I need to do some setting changes after my SKSpriteNode stops moving. First, I apply force on my SKSpriteNode, so it starts moving due to the force acting on it. Now, i need to know when it stops moving. I know that SKSpriteNode has a…
user4202109
1
vote
1 answer

Create Dynamic Body using cocos 2d js and Chipmunk

I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic. this.space = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new…
Sameer Hussain
  • 2,421
  • 8
  • 23
  • 41
1
vote
1 answer

unity OnTriggerExit2D doesn't work always

I have small unity game, where I instantiate finger clone from a prefab that has movement and animation script attached to it, a box collider object equal to view port size that detects collisions, and an increase object counter (i.e, counter of no…
Vishal Sharma
  • 178
  • 10
1
vote
0 answers

SpriteKit physics false positive?

The contact point provided by didBeginContact does not always rest in the paths that define the physics bodies involved in the collision. This behavior is most problematic in cases where the bodies never come into contact (if the circle node is 1px…
Ian
  • 592
  • 5
  • 21
1
vote
2 answers

2D Game Physics: Hitting a platform actor won't stop

If in a game, the actor was jumping if he was to hit a platform. What would i need to set the velocity/position/gravity in order to make him stop on the platform? Any pointers on game physics would be great. I think it's something like this? Vector2…
BradleyIW
  • 1,338
  • 2
  • 20
  • 37
1
vote
1 answer

Circular orbit formula is not working in unity 3D

I am working on a game where I have to implement some space physics like orbits and gravity.... My main problem is that I'am not able to make a GameObject orbit correctly around a planet (or another object ) , I am trying to do that using an old…
1
vote
1 answer

Move the SKSpriteNode to the actual touch point in ios Game

I have a SKSpriteNode, which is a ball. My view don't have gravity. I'm able to move the ball by applying an impulse over it in the start and I want to make it to move to the user touch point which we can get in -(void)touchesBegan:(NSSet *)touches…
Jaffer Sheriff
  • 1,444
  • 13
  • 33
1
vote
2 answers

How to make 4 vectors (all which you know the direction but you can set the magnitude) add up to a known vector?

So if you have 4 vectors, and you know their directions (which all could be different), and you could change all their magnitudes, what would you set the magnitudes equal to if you want all 4 vectors to add up to another vector which you know? This…
1
vote
1 answer

Crash when transorm body in AndEngine

I am developing a game in and engine. Its crashing with very annoying error message. Crash is occurs when transform body to change the position. I am using body.setTransform method to change the position. My code is following. public Scene…
Navdeep Soni
  • 449
  • 4
  • 15
1
vote
1 answer

Unity3D Mecanim Character stopping before turning

so for the past few days I've been working on a character controller in Unity3D using mecanim. It's not based off of my own code, but off of a tutorial I found online, of course that tutorial was meant for Unity 4, so I am running in to small…
LAKster
  • 151
  • 1
  • 1
  • 12
1
vote
1 answer

Projectile Physics - Why do i get a different result when using Time.sinceLevelLoad over Time.delatime in Unity?

I'm playing around with projectile physics on objects in Unity. In this case I'm just using a sphere object and calculating it's vector and the path it should take based on gravity (leaving other forces like friction out for the moment). The formula…
Zy0n
  • 810
  • 2
  • 14
  • 33
1
vote
2 answers

Ruby Gosu how to start new time on click

Im trying to simply move an image on click from the one side of the screen to another. But I can't quite figure out how to work with time. Basically I need to start moving a ball after a Gosu::KbReturn. Any help would be much appreaciated require…
Richardlonesteen
  • 584
  • 5
  • 18
1
vote
1 answer

How to reset its position back to the origin when it reach the end of frame? javascript

var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create}); function preload() { // You can fill the preloader with as many assets as your game requires // Here we are loading an image. The…
1
vote
1 answer

Point adding mechanism troubles?

I have this game where the goal is to pass a ball through oncoming rectangles with gaps in them. Point gains are registered when the ball's x position falls within a certain margin (plus or minus) from the right of the rectangle being passed by the…
Benyam Ephrem
  • 448
  • 6
  • 20
1
vote
1 answer

Enemy object doesn't move LibGDX

I have a .txt file Block 128 0 Block 192 0 Block 256 0 Block 320 0 ... ... ... Enemy 1000 64 500 500 Enemy 1474 64 290 250 and here is my reading method (enemies and list are global variables) ArrayList enemies =…
David
  • 3,055
  • 4
  • 30
  • 73
1 2 3
99
100